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
If a __host__ function is declared as extern "C", but the definition isn't labelled as extern "C", hipcc/hcc produces a mangled symbol in the resulting object file. However, if the definition also has an extern "C" label, the symbol is non-mangled as expected. Also, this unexpected behaviour doesn't occur for __global__ functions (they produce the expected non-mangled symbol regardless of whether the definition also has an extern "C"). Below is a testcase for the same:
from the look of it it's related to HCC Clang CodeGen. probably better file the ticket in hcc repo
jithunnair-amd
changed the title
extern "C" (on declaration only) doesn't produce non-mangled symbols for __host__ functions
extern "C" (on declaration only) produces mangled symbols for __host__ functions
Aug 14, 2018
If a
__host__
function is declared asextern "C"
, but the definition isn't labelled asextern "C"
,hipcc
/hcc
produces a mangled symbol in the resulting object file. However, if the definition also has anextern "C"
label, the symbol is non-mangled as expected. Also, this unexpected behaviour doesn't occur for__global__
functions (they produce the expected non-mangled symbol regardless of whether the definition also has anextern "C"
). Below is a testcase for the same:experiment.h:
extern "C" void FuncA(int exp);
experiment.cu:
#include <stdio.h>
#include "experiment.h"
#include "hip/hip_runtime.h"
/*extern "C"*/ __host__ void FuncA(int exp) {
printf("I got %d", exp);
}
Compile command:
hipcc -fPIC -c experiment.cu -o experiment.o
rocm-user@51f7736e9394:~/experiment$ nm experiment.o | grep FuncA
00000000000038e0 T _Z5FuncAi
The text was updated successfully, but these errors were encountered: