[libc-commits] [libc] [libc] Add Kernel Resource Usage to nvptx-loader (PR #97503)

via libc-commits libc-commits at lists.llvm.org
Sun Jul 14 18:14:00 PDT 2024


================
@@ -15,13 +15,30 @@ function(add_benchmark benchmark_name)
   endif()
   add_libc_hermetic(
     ${benchmark_name}
-    IS_BENCHMARK
+    IS_GPU_BENCHMARK
     LINK_LIBRARIES
       LibcGpuBenchmark.hermetic
       ${BENCHMARK_LINK_LIBRARIES}
     ${BENCHMARK_UNPARSED_ARGUMENTS}
   )
   get_fq_target_name(${benchmark_name} fq_target_name)
+  set(fq_build_target_name ${fq_target_name}.__build__)
+
+  # We want to dump kernel resource usage for GPU benchmarks
+  get_target_property(gpu_loader_exe libc.utils.gpu.loader "EXECUTABLE")
+  set(res_usage_cmd $<$<BOOL:${LIBC_TARGET_OS_IS_GPU}>:${gpu_loader_exe}>
+    ${CMAKE_CROSSCOMPILING_EMULATOR}
----------------
jameshu15869 wrote:

I think I misinterpreted what we talked about before and made `nvptx-loader --print-resource-usage` only print and disable running the kernel - This was like the 2nd cmd that you run for `nvptx-loader` after launching the kernel just to see the register usage

https://github.com/llvm/llvm-project/pull/97503


More information about the libc-commits mailing list