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

[SYCL] Add AMDGPU_kernel calling convention to detected kernels #14581

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion llvm/lib/SYCLLowerIR/ModuleSplitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ bool isGenericBuiltin(StringRef FName) {
}

bool isKernel(const Function &F) {
return F.getCallingConv() == CallingConv::SPIR_KERNEL;
return F.getCallingConv() == CallingConv::SPIR_KERNEL ||
F.getCallingConv() == CallingConv::AMDGPU_KERNEL;
}

bool isEntryPoint(const Function &F, bool EmitOnlyKernelsAsEntryPoints) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
; -- Per-kernel split
; RUN: sycl-post-link -split=kernel -emit-only-kernels-as-entry-points -S < %s -o %tC.table
; RUN: FileCheck %s -input-file=%tC_0.ll --check-prefixes CHECK-A0
; RUN: FileCheck %s -input-file=%tC_1.ll --check-prefixes CHECK-A1

define dso_local amdgpu_kernel void @Kernel1() {
ret void
}

define dso_local amdgpu_kernel void @Kernel2() {
ret void
}

; CHECK-A0: define dso_local amdgpu_kernel void @Kernel2()
; CHECK-A0-NOT: define dso_local amdgpu_kernel void @Kernel1()
; CHECK-A1-NOT: define dso_local amdgpu_kernel void @Kernel2()
; CHECK-A1: define dso_local amdgpu_kernel void @Kernel1()
2 changes: 1 addition & 1 deletion sycl/test-e2e/KernelAndProgram/free_function_apis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// RUN: %{run} %t.out

// The name mangling for free function kernels currently does not work with PTX.
// UNSUPPORTED: cuda, hip
// UNSUPPORTED: cuda

#include <iostream>
#include <sycl/detail/core.hpp>
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/KernelAndProgram/free_function_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// RUN: %{run} %t.out

// The name mangling for free function kernels currently does not work with PTX.
// UNSUPPORTED: cuda, hip
// UNSUPPORTED: cuda

// This test tests free function kernel code generation and execution.

Expand Down Expand Up @@ -212,7 +212,7 @@ SYCL_EXTERNAL SYCL_EXT_ONEAPI_FUNCTION_PROPERTY((
ptr2D[GId.get(0)][GId.get(1)] = LId.get(0) + LId.get(1) + start;
}

// Explicit instantiation with int*.
// Explicit instantiation with "int*".
template void ff_3(int *ptr, int start);

bool test_3(queue Queue) {
Expand Down
Loading