6

Some projects use

#pragma nv_exec_check_disable

and/or

#pragma hd_warning_disable

to silence NVCC warnings about

warning: calling a __host__ function from a __host__ __device__ function is not allowed`

However they seem completely undocumented, e.g. in the CUDA 9.1 reference.

Is there any relevant documentation anywhere ?

fwyzard
  • 2,364
  • 1
  • 21
  • 19
  • Some relevant discussion at: https://stackoverflow.com/questions/49721617 . According to an expert, these #pragma's are indeed undocumented. As suggested by that other SO question, projects like Thrust have some helpful examples of using these #pragmas: https://github.com/thrust/thrust/issues/688 . But would be great to have some official support/documentation for these in a future CUDA release. – davewy Apr 08 '18 at 20:10
  • 1
    See also [this](https://stackoverflow.com/questions/30029197/template-host-device-calling-host-defined-functions) – Robert Crovella Sep 06 '18 at 15:10
  • @davewy: Your first link is to a deleted question. – einpoklum Apr 22 '19 at 15:06
  • 1
    Thanks @einpoklum -- that question described how I was writing a CUDA application that depended on an external library (Eigen). Using CUDA 9.1 / nvcc 9.1.85 / gcc 6.3, some files in Eigen raise a number of compiler warnings (not errors), all along the lines of `warning: calling a __host__ function from a __host__ __device__ function is not allowed` And I was asking for a way to either silence that warning globally in nvcc or silence all warnings in the Eigen directory. Closest answer I got there was the aforementioned link to what Thrust does; never found an ideal solution. – davewy Apr 26 '19 at 02:47
  • 1
    @davewy: that is exactly my use case as well. I would love if one could specialise a template based on the *attrbitues* of the template argument type... – fwyzard Apr 27 '19 at 06:51
  • @fwyzard: I know this is an old question and you probably don't care about it any more, but I have added a short community wiki answer, and I would greatly appreciate if you could accept it just so it falls off the unanswered queue for the CUDA tag – talonmies Jun 01 '20 at 16:12

1 Answers1

3

As was indicated in comments and a now (incorrectly) moderator deleted answer, all pragmas supported by cicc (the front end parser for device code) remain undocumented.

However, if you are truly interested in what might or might not be supported, you can look through the strings stored in ciccand see that there are an apparent cornucopia of feature control pragmas in the executable. All undocumented, unfortunately.

talonmies
  • 70,661
  • 34
  • 192
  • 269