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

[HCC] Program crash with missing constructor #1314

Closed
davidrohr opened this issue Aug 9, 2019 · 5 comments
Closed

[HCC] Program crash with missing constructor #1314

davidrohr opened this issue Aug 9, 2019 · 5 comments
Labels

Comments

@davidrohr
Copy link
Contributor

The program below crashes during hipLaunchKernelGGL instead of giving a failure at compile time, that the constructor for a is defined but not implemented:

#include <hip/hip_runtime.h>

class a
{
public:
    __device__ a();
    int x = 0;
};

__global__ void run_printf()
{
    a aa;
}

int main() {
    hipLaunchKernelGGL(HIP_KERNEL_NAME(run_printf), dim3(1), dim3(1), 0, 0);
    hipDeviceSynchronize();
}

Compiler simply via: hipcc -o test test.hip.cpp with ROCM 2.6 and a Radeon7 GPU.

@emankov
Copy link
Contributor

emankov commented Aug 10, 2019

Good catch! Going to check with CUDA (nvcc and clang) and with hip-clang (clang -x hip). Anyway, the issue is related to HCC compiler rather than HIP.

@emankov emankov changed the title Program crash with missing constructor [HCC] Program crash with missing constructor Aug 10, 2019
@davidrohr
Copy link
Contributor Author

This may be, but I never used hcc standalone, so I don't have an example for hcc only, so I thought it is better to open a bug report here. Do you want me to open an issue for HCC as well?

@emankov
Copy link
Contributor

emankov commented Aug 10, 2019

hipcc goes through HCC compiler, clang -x hip goes through HIP compiler resided in clang.

Do you want me to open an issue for HCC as well?

I think maybe later. We need to compare between compilers. I've marked the bug as HCC here.

@davidrohr
Copy link
Contributor Author

I tried this with HIP_COMPILER=clang, and in that case it correctly identifies the missing symbol during compilation: 'lld: error: undefined hidden symbol: a::a()`
So, this problem appears only with HCC.

@emankov
Copy link
Contributor

emankov commented Sep 2, 2019

Yes, the problem is only HCC specific. CUDA through nvcc and through clang reports the analogous linking error. Could you please file this issue in HCC?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants