Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CUDA][SPIRV] Use OpenCLKernel CC for CUDA -> SPIRV
Select the OpenCLKernel calling convention for kernels when compiling CUDA targeting SPIR-V. In this way the generated LLVM IR will have a spir_kernel calling convention that will be translated to an OpEntryPoint when converting to SPIRV. Reviewed By: jlebar, tra Differential Revision: https://reviews.llvm.org/D114407
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// RUN: %clang_cc1 -fcuda-is-device -triple spirv32 -o - -emit-llvm -x cuda %s | FileCheck %s | ||
// RUN: %clang_cc1 -fcuda-is-device -triple spirv64 -o - -emit-llvm -x cuda %s | FileCheck %s | ||
|
||
// Verifies that building CUDA targeting SPIR-V {32,64} generates LLVM IR with | ||
// spir_kernel attributes for kernel functions. | ||
|
||
// CHECK: define spir_kernel void @_Z6kernelv() | ||
|
||
__attribute__((global)) void kernel() { return; } |