From 4ea06f3a28bc0e05ce782a928ef3b79cf763c92a Mon Sep 17 00:00:00 2001 From: Rahul Garg Date: Thu, 8 Aug 2019 01:27:41 -0700 Subject: [PATCH] Add support for hipFuncGetAttribute (#1279) * Add support for hipFunGetAttribute * Support NVCC path * Test using sample module_api_global * Try fixing CI build failure due to hip_prof_gen scan * Fix for CI build issue * Resolve conflict * Rebase and resolve conflicts with master * Fix build error * Fix NVCC path build error --- samples/0_Intro/module_api_global/runKernel.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/samples/0_Intro/module_api_global/runKernel.cpp b/samples/0_Intro/module_api_global/runKernel.cpp index 7031b9f898..7aa7f7ba2d 100644 --- a/samples/0_Intro/module_api_global/runKernel.cpp +++ b/samples/0_Intro/module_api_global/runKernel.cpp @@ -124,6 +124,11 @@ int main() { { hipFunction_t Function; HIP_CHECK(hipModuleGetFunction(&Function, Module, "test_globals")); + int val =-1; + HIP_CHECK(hipFuncGetAttribute(&val, HIP_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES,Function)); + printf("Shared Size Bytes = %d\n",val); + HIP_CHECK(hipFuncGetAttribute(&val, HIP_FUNC_ATTRIBUTE_NUM_REGS, Function)); + printf("Num Regs = %d\n",val); HIP_CHECK(hipModuleLaunchKernel(Function, 1, 1, 1, LEN, 1, 1, 0, 0, NULL, (void**)&config)); hipMemcpyDtoH(B, Bd, SIZE);