Skip to content

Commit

Permalink
Optimize and simplify OpenCL support (#363)
Browse files Browse the repository at this point in the history
* Reduce OCL overhead

* Reduce OCL overhead

* Reduce OCL overhead

* Optimize OpenCL support

* OpenCL optimization

* Optimize OpencL

* Optimize and simplify OpenCL support

* Optimize and simplify OpenCL support

* Optimize and simplify OpenCL support

* Optimize and simplify OpenCL support

* Optimize/simplify OpenCL support

* Simplify and optimize OpenCL
  • Loading branch information
zma2 authored Nov 21, 2024
1 parent cda4eab commit bfca98d
Show file tree
Hide file tree
Showing 11 changed files with 1,497 additions and 1,244 deletions.
2 changes: 0 additions & 2 deletions tools/unitrace/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ if (BUILD_WITH_MPI)
endif()

add_library(unitrace_tool SHARED
"${PROJECT_SOURCE_DIR}/src/opencl/cl_ext_collector.cc"
"${PROJECT_SOURCE_DIR}/../../utils/trace_guard.cc"
"${PROJECT_SOURCE_DIR}/src/tracer.cc")
link_directories(${ONEAPI_COMPILER_HOME}/lib)
find_package(Xptifw REQUIRED)
Expand Down
11 changes: 2 additions & 9 deletions tools/unitrace/src/chromelogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
#include "unievent.h"
#include "unimemory.h"

#include "opencl/cl_ext_collector.h"

#include "common_header.gen"

static inline std::string GetHostName(void) {
Expand Down Expand Up @@ -114,8 +112,8 @@ typedef struct TraceDataPacket_ {
name = utils::Demangle(name.data());
}
else {
if ((cl_ext_api_id)api_id > clExtApiIdStartTraceId && (cl_ext_api_id)api_id < clExtApiIdEndTraceId) {
name = cl_ext_api_id_name[api_id - clExtApiIdStartTraceId - 1];
if ((cl_ext_api_id)api_id >= ClExtApiStart && (cl_ext_api_id)api_id < ClExtApiEnd) {
name = cl_ext_api[api_id - ClExtApiStart];
} else if ((api_id != OpenClTracingId) && (api_id != XptiTracingId) && (api_id != IttTracingId) && (api_id != ZeKernelTracingId)) {
// L0 kernel names are already demanged/
name = get_symbol(api_id);
Expand Down Expand Up @@ -1525,11 +1523,6 @@ class ChromeLogger {
}
}
}

static void ClExtChromeCallLoggingCallback(std::vector<uint64_t> *kids, FLOW_DIR flow_dir, const cl_ext_api_id api_id,
uint64_t started, uint64_t ended) {
ClChromeCallLoggingCallback(kids, flow_dir, (API_TRACING_ID)api_id, started, ended);
}
};

#endif // PTI_TOOLS_COMMON_CHROME_LOGGER_H_
6 changes: 3 additions & 3 deletions tools/unitrace/src/opencl/cl_api_callbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
// SPDX-License-Identifier: MIT
// =============================================================

#ifndef PTI_TOOLS_CL_TRACER_CL_API_CALLBACKS_H_
#define PTI_TOOLS_CL_TRACER_CL_API_CALLBACKS_H_
#ifndef PTI_TOOLS_UNITRACE_CL_API_CALLBACKS_H_
#define PTI_TOOLS_UNITRACE_CL_API_CALLBACKS_H_

#include <sstream>

Expand Down Expand Up @@ -7394,4 +7394,4 @@ void OnExitFunction(
}
}

#endif // PTI_TOOLS_CL_TRACER_CL_API_CALLBACKS_H_
#endif /* PTI_TOOLS_UNITRACE_CL_API_CALLBACKS_H_ */
Loading

0 comments on commit bfca98d

Please sign in to comment.