Skip to content

Commit

Permalink
Add CK_TIME_KERNEL as toggleable CMake Variable (#1794)
Browse files Browse the repository at this point in the history
* Disable CK_TIME_KERNEL by Default, Add as CMake Variable

* Enable CK_TIME_KERNEL by Default, Maintaining CMake Variable Functionality.

* Fix build error.
  • Loading branch information
lucbruni-amd authored Jan 20, 2025
1 parent 86d1b46 commit 3fb2f5a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ if(CK_USE_CODEGEN)
add_definitions(-DCK_USE_CODEGEN)
endif()

option(CK_TIME_KERNEL "Enable kernel time tracking" ON)
if(CK_TIME_KERNEL)
add_definitions(-DCK_TIME_KERNEL=1)
else()
add_definitions(-DCK_TIME_KERNEL=0)
endif()

include(getopt)

# CK version file to record release version as well as git commit hash
Expand Down
2 changes: 2 additions & 0 deletions include/ck/ck.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ CK_DECLARE_ENV_VAR_BOOL(CK_LOGGING)

// to do: add various levels of logging with CK_LOG_LEVEL

#ifndef CK_TIME_KERNEL
#define CK_TIME_KERNEL 1
#endif

// constant address space for kernel parameter
// https://llvm.org/docs/AMDGPUUsage.html#address-spaces
Expand Down

0 comments on commit 3fb2f5a

Please sign in to comment.