Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Enable opt-in L1 caching via nvcc-wrapper #261

Closed
mcarilli opened this issue Apr 28, 2016 · 1 comment
Closed

Suggestion: Enable opt-in L1 caching via nvcc-wrapper #261

mcarilli opened this issue Apr 28, 2016 · 1 comment
Assignees
Labels
Feature Request Create new capability; will potentially require voting
Milestone

Comments

@mcarilli
Copy link

Hi Kokkos Team,

During my compilation adventures I tried to opt-into L1 caching on Kepler using the compiler flag -Xptxas="-dlcm=ca" as described here.

However, simply adding -Xptxas="-dlcm=ca" to CXXFLAGS in the makefile failed, because apparently CXXFLAGS is passed to both the host compiler and nvcc, and the host compiler did not recognize the option.

After some poking around, I fixed the problem by appending -Xptxas="-dlcm=ca" to the list of "known nvcc args" at line 110 of nvcc_wrapper.

old:

  #Handle known nvcc args
  -gencode*|--dryrun|--verbose|--keep|--keep-dir*|-G|--relocatable-device-code*|-lineinfo|-expt-extended-lambda|--resource-usage)
    cuda_args="$cuda_args $1"

new:

  #Handle known nvcc args
  -gencode*|--dryrun|--verbose|--keep|--keep-dir*|-G|--relocatable-device-code*|-lineinfo|-expt-extended-lambda|--resource-usage|-Xptxas="-dlcm=ca")
    cuda_args="$cuda_args $1"

I think you should consider adding -Xptxas="-dlcm=ca" to nvcc_wrapper permanently, since it is a small change that adds functionality and is unlikely to break anything. You may also wish to add its sibling that disables L1 caching, -Xptxas="-dlcm=cg".

Hope this helps,
Michael

@crtrott
Copy link
Member

crtrott commented Apr 28, 2016

I can look into adding something for this. Btw. nvcc_wrapper is now maintained in its own little repository (kokkos/nvcc_wrapper), so I will first add it there before pulling it into Kokkos.

@hcedwar hcedwar added the Feature Request Create new capability; will potentially require voting label May 4, 2016
@hcedwar hcedwar added this to the Spring 2016 milestone May 4, 2016
crtrott added a commit to kokkos/nvcc_wrapper that referenced this issue May 4, 2016
This will handle options such as -Xptxas="-dlcm=ca" etc.
This addresses issue kokkos/kokkos#261
@crtrott crtrott closed this as completed May 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Create new capability; will potentially require voting
Projects
None yet
Development

No branches or pull requests

3 participants