-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCLomatic] Ensure wrappers are only generated under C language link…
…age and for __global__ functions (#338) * [SYCLomatic] Ensure wrappers are only generated under C language linkage and for __global__ functions Signed-off-by: Cai, Justin <justin.cai@intel.com> * Fix other module lit test * Move check to isModuleFunction * Fix windows lit test * Fix windows lit test 2 * Add more cases in lit test Signed-off-by: Cai, Justin <justin.cai@intel.com>
- Loading branch information
Showing
4 changed files
with
41 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// RUN: dpct --extra-arg="--ptx" \ | ||
// RUN: --out-root=%T/module_wrapper_gen \ | ||
// RUN: --cuda-include-path="%cuda-path/include" %s | ||
// RUN: FileCheck %s --input-file=%T/module_wrapper_gen/module_wrapper_gen.dp.cpp | ||
|
||
// START | ||
|
||
__device__ float2 operator+(float2 a, float2 b) { | ||
return float2{a.x - b.x, a.y - b.y}; | ||
} | ||
|
||
extern "C" __device__ void externCNonKernel() {} | ||
|
||
__device__ void deviceFun() {} | ||
|
||
__global__ void nonExternCKernel() {} | ||
|
||
extern "C" __global__ void exampleKernel() { | ||
float2 x; | ||
float2 y; | ||
float2 z = x + y; | ||
} | ||
|
||
// END | ||
|
||
// Only one _wrapper should be generated. | ||
// CHECK: // START | ||
// CHECK: _wrapper | ||
// CHECK-NOT: _wrapper | ||
// CHECK: // END |