This patch adds the necessary AMDGPU calling convention to the ctor / dtor kernels. These are fundamentally device kenels called by the host on image load. Without this calling convention information the AMDGPU plugin is unable to identify them. Depends on D122504 Fixes #54091 Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D122515
26 lines
350 B
C++
26 lines
350 B
C++
// RUN: %libomptarget-compilexx-generic && %libomptarget-run-generic | %fcheck-generic
|
|
|
|
#include <cstdio>
|
|
|
|
int foo() { return 1; }
|
|
|
|
class C {
|
|
public:
|
|
C() : x(foo()) {}
|
|
|
|
int x;
|
|
};
|
|
|
|
C c;
|
|
#pragma omp declare target(c)
|
|
|
|
int main() {
|
|
int x = 0;
|
|
#pragma omp target map(from : x)
|
|
{ x = c.x; }
|
|
|
|
// CHECK: PASS
|
|
if (x == 1)
|
|
printf("PASS\n");
|
|
}
|