Skip to content

Commit

Permalink
Improvements thanks to review.
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenarnst committed Nov 19, 2023
1 parent c390533 commit 194a1fd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 29 deletions.
2 changes: 1 addition & 1 deletion profiling/nvtx-connector/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CXX=g++
CXXFLAGS=-O3 -std=c++11 -g -I$(CUDA_ROOT)/include/
CXXFLAGS=-O3 -std=c++11 -g -I$(CUDA_ROOT)/include
LDFLAGS=-L$(CUDA_ROOT)/lib64
LIBS=-lnvToolsExt
SHARED_CXXFLAGS=-shared -fPIC
Expand Down
4 changes: 2 additions & 2 deletions profiling/roctx-connector/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ find_path(ROCM_ROCTX_INCLUDE roctx.h REQUIRED HINTS $ENV{ROCM_PATH}/include/roct

kp_add_library(kp_roctx_connector kp_roctx_connector.cpp)

target_include_directories(kp_roctx_connector PUBLIC ${ROCM_ROCTX_INCLUDE})
target_link_libraries(kp_roctx_connector PUBLIC ${ROCM_ROCTX_LIB})
target_include_directories(kp_roctx_connector PRIVATE ${ROCM_ROCTX_INCLUDE})
target_link_libraries(kp_roctx_connector PRIVATE ${ROCM_ROCTX_LIB})
37 changes: 11 additions & 26 deletions profiling/roctx-connector/kp_roctx_connector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,18 @@ namespace ROCTXConnector {

static bool tool_globfences;

void kokkosp_request_tool_settings(
const uint32_t, Kokkos_Tools_ToolSettings* settings) {
void kokkosp_request_tool_settings(const uint32_t,
Kokkos_Tools_ToolSettings* settings) {
if (tool_globfences) {
settings->requires_global_fencing = true;
} else {
settings->requires_global_fencing = false;
}
}

void kokkosp_init_library(const int loadSeq,
const uint64_t interfaceVer,
void kokkosp_init_library(const int loadSeq, const uint64_t interfaceVer,
const uint32_t /*devInfoCount*/,
Kokkos_Profiling_KokkosPDeviceInfo* /*deviceInfo*/) {

const char* tool_global_fences = std::getenv("KOKKOS_TOOLS_GLOBALFENCES");
if (tool_global_fences) {
tool_globfences = (atoi(tool_global_fences) != 0);
Expand All @@ -58,7 +56,6 @@ void kokkosp_init_library(const int loadSeq,
std::cout << "-----------------------------------------------------------\n"
<< "KokkosP: ROC Tracer Connector (sequence is " << loadSeq
<< ", version: " << interfaceVer << ")\n"
<< "Global fences: " << (tool_globfences ? "ON" : "OFF") << "\n"
<< "-----------------------------------------------------------\n";

roctxMark("Kokkos::Initialization Complete");
Expand All @@ -74,44 +71,32 @@ KokkosP: Finalization of ROC Tracer Connector. Complete.
roctxMark("Kokkos::Finalization Complete");
}

void kokkosp_begin_parallel_for(const char* name,
const uint32_t /*devID*/,
void kokkosp_begin_parallel_for(const char* name, const uint32_t /*devID*/,
uint64_t* /*kID*/) {
roctxRangePush(name);
}

void kokkosp_end_parallel_for(const uint64_t /*kID*/) {
roctxRangePop();
}
void kokkosp_end_parallel_for(const uint64_t /*kID*/) { roctxRangePop(); }

void kokkosp_begin_parallel_scan(const char* name,
const uint32_t /*devID*/,
void kokkosp_begin_parallel_scan(const char* name, const uint32_t /*devID*/,
uint64_t* /*kID*/) {
roctxRangePush(name);
}

void kokkosp_end_parallel_scan(const uint64_t /*kID*/) {
roctxRangePop();
}
void kokkosp_end_parallel_scan(const uint64_t /*kID*/) { roctxRangePop(); }

void kokkosp_begin_parallel_reduce(const char* name,
const uint32_t /*devID*/,
void kokkosp_begin_parallel_reduce(const char* name, const uint32_t /*devID*/,
uint64_t* /*kID*/) {
roctxRangePush(name);
}

void kokkosp_end_parallel_reduce(const uint64_t /*kID*/) {
roctxRangePop();
}
void kokkosp_end_parallel_reduce(const uint64_t /*kID*/) { roctxRangePop(); }

void kokkosp_push_profile_region(const char* name) {
roctxRangePush(name);
}
void kokkosp_push_profile_region(const char* name) { roctxRangePush(name); }

void kokkosp_pop_profile_region() { roctxRangePop(); }

void kokkosp_create_profile_section(const char* name,
uint32_t* sID) {
void kokkosp_create_profile_section(const char* name, uint32_t* sID) {
*sID = kokkosp_sections.size();
kokkosp_sections.push_back(
{std::string(name), static_cast<roctx_range_id_t>(-1)});
Expand Down

0 comments on commit 194a1fd

Please sign in to comment.