You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hip_macro.cpp:19:5: error: no matching function for call to 'foo'
foo();
^~~
hip_macro.cpp:10:9: note: candidate function not viable: call to __host__ function from __global__ function
HD void foo(){
Why does hipcc parse device function once again when compiling for host target? And send an error for device function but the device code has already been generated. That does not make sense.
Real world problem:
Some header files have something like
When these header files are included in cuda source file, hipcc can not handle correctly. I know __CUDACC__ will be ok, but __CUDA_ARCH__\ __HIP_DEVICE_COMPILE__ should be ok too. This is a problem caused by the design of compiler not caused by the language standard.
Operating System
Ubuntu22.04
CPU
R5 7500F
GPU
gfx906
ROCm Version
ROCm 6.1.0
ROCm Component
No response
Steps to Reproduce
No response
(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered:
aywala
changed the title
[Issue]: [HIP] Report error about device function while device code has already been generated
[Issue]: [HIP] Report error about device/global function while device-side code has already been generated
Nov 27, 2024
There is a reason __host__ exists, and that is exactly it. I don't think this is an issue. The code in the description doesn't conform with the programming model IMO.
Problem Description
This code sample is error with hipcc. It report an error when compiling for host.
https://godbolt.org/z/dGG5zEhEc
This code sample is ok with nvcc.
Why does hipcc parse device function once again when compiling for host target? And send an error for device function but the device code has already been generated. That does not make sense.
Real world problem:
Some header files have something like
When these header files are included in cuda source file, hipcc can not handle correctly. I know
__CUDACC__
will be ok, but__CUDA_ARCH__
\__HIP_DEVICE_COMPILE__
should be ok too. This is a problem caused by the design of compiler not caused by the language standard.Operating System
Ubuntu22.04
CPU
R5 7500F
GPU
gfx906
ROCm Version
ROCm 6.1.0
ROCm Component
No response
Steps to Reproduce
No response
(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: