mirror of
https://github.com/intel/llvm.git
synced 2026-01-29 12:53:33 +08:00
[AMDGPU] Enable the implicit arguments for HIP (CLANG)
Enable 48-bytes of implicit arguments for HIP as well. Earlier it was enabled for OpenCL. This code is specific to AMDGPU target. Differential Revision: https://reviews.llvm.org/D62244 llvm-svn: 363414
This commit is contained in:
@@ -7868,7 +7868,8 @@ void AMDGPUTargetCodeGenInfo::setTargetAttributes(
|
||||
const auto *ReqdWGS = M.getLangOpts().OpenCL ?
|
||||
FD->getAttr<ReqdWorkGroupSizeAttr>() : nullptr;
|
||||
|
||||
if (M.getLangOpts().OpenCL && FD->hasAttr<OpenCLKernelAttr>() &&
|
||||
if (((M.getLangOpts().OpenCL && FD->hasAttr<OpenCLKernelAttr>()) ||
|
||||
(M.getLangOpts().HIP && FD->hasAttr<CUDAGlobalAttr>())) &&
|
||||
(M.getTriple().getOS() == llvm::Triple::AMDHSA))
|
||||
F->addFnAttr("amdgpu-implicitarg-num-bytes", "48");
|
||||
|
||||
|
||||
8
clang/test/CodeGenCUDA/amdgpu-hip-implicit-kernarg.cu
Normal file
8
clang/test/CodeGenCUDA/amdgpu-hip-implicit-kernarg.cu
Normal file
@@ -0,0 +1,8 @@
|
||||
// REQUIRES: amdgpu-registered-target
|
||||
// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -fcuda-is-device -emit-llvm -x hip -o - %s | FileCheck %s
|
||||
#include "Inputs/cuda.h"
|
||||
|
||||
__global__ void hip_kernel_temp() {
|
||||
}
|
||||
|
||||
// CHECK: attributes {{.*}} = {{.*}} "amdgpu-implicitarg-num-bytes"="48"
|
||||
Reference in New Issue
Block a user