hip-vdi changes

This commit is contained in:
Evgeny
2019-10-25 00:53:26 -05:00
orang tua 064a7021a0
melakukan eb4bf2dac6
5 mengubah file dengan 17 tambahan dan 7 penghapusan
+2 -3
Melihat File
@@ -172,11 +172,10 @@ typedef BaseLoader<RocTxApi> RocTxLoader;
#define LOADER_INSTANTIATE() \ #define LOADER_INSTANTIATE() \
template<class T> typename roctracer::BaseLoader<T>::mutex_t roctracer::BaseLoader<T>::mutex_; \ template<class T> typename roctracer::BaseLoader<T>::mutex_t roctracer::BaseLoader<T>::mutex_; \
template<class T> std::atomic<roctracer::BaseLoader<T>*> roctracer::BaseLoader<T>::instance_{}; \ template<class T> std::atomic<roctracer::BaseLoader<T>*> roctracer::BaseLoader<T>::instance_{}; \
template<class T> const bool roctracer::BaseLoader<T>::strong_ld_check_ = false; template<class T> const bool roctracer::BaseLoader<T>::strong_ld_check_ = true; \
template<> const char* roctracer::HipLoader::lib_name_ = "libhip_hcc.so"; \ template<> const char* roctracer::HipLoader::lib_name_ = "libhip_hcc.so"; \
template<> const char* roctracer::HccLoader::lib_name_ = "libmcwamp_hsa.so"; \ template<> const char* roctracer::HccLoader::lib_name_ = "libmcwamp_hsa.so"; \
template<> const char* roctracer::KfdLoader::lib_name_ = "libkfdwrapper64.so"; \ template<> const char* roctracer::KfdLoader::lib_name_ = "libkfdwrapper64.so"; \
template<> const char* roctracer::RocTxLoader::lib_name_ = "libroctx64.so"; \ template<> const char* roctracer::RocTxLoader::lib_name_ = "libroctx64.so";
template<> const bool roctracer::RocTxLoader::strong_ld_check_ = false;
#endif // SRC_CORE_LOADER_H_ #endif // SRC_CORE_LOADER_H_
+2
Melihat File
@@ -324,10 +324,12 @@ void* HIP_SyncActivityCallback(
if ((data == NULL) && (pool != NULL)) EXC_ABORT(ROCTRACER_STATUS_ERROR, "ActivityCallback enter: pool is not NULL"); if ((data == NULL) && (pool != NULL)) EXC_ABORT(ROCTRACER_STATUS_ERROR, "ActivityCallback enter: pool is not NULL");
// Allocating a record if NULL passed // Allocating a record if NULL passed
if (record == NULL) { if (record == NULL) {
if (data != NULL) EXC_ABORT(ROCTRACER_STATUS_ERROR, "ActivityCallback enter: record is NULL");
record_pair_stack.push({}); record_pair_stack.push({});
auto& top = record_pair_stack.top(); auto& top = record_pair_stack.top();
record = &(top.record); record = &(top.record);
data_ptr = &(top.data.hip); data_ptr = &(top.data.hip);
data = data_ptr;
} }
// Filing record info // Filing record info
@@ -291,6 +291,8 @@ void activity_callback(const char* begin, const char* end, void* arg) {
// Init tracing routine // Init tracing routine
void init_tracing() { void init_tracing() {
std::cout << "# INIT #############################" << std::endl << std::flush; std::cout << "# INIT #############################" << std::endl << std::flush;
// roctracer properties
roctracer_set_properties(ACTIVITY_DOMAIN_HIP_API, NULL);
// Allocating tracing pool // Allocating tracing pool
roctracer_properties_t properties{}; roctracer_properties_t properties{};
properties.buffer_size = 0x1000; properties.buffer_size = 0x1000;
@@ -320,6 +322,7 @@ void stop_tracing() {
std::cout << "# STOP #############################" << std::endl << std::flush; std::cout << "# STOP #############################" << std::endl << std::flush;
} }
#else #else
void init_tracing() {}
void start_tracing() {} void start_tracing() {}
void stop_tracing() {} void stop_tracing() {}
#endif #endif
+8 -2
Melihat File
@@ -25,7 +25,7 @@
# enable tools load failure reporting # enable tools load failure reporting
export HSA_TOOLS_REPORT_LOAD_FAILURE=1 export HSA_TOOLS_REPORT_LOAD_FAILURE=1
# paths to ROC profiler and oher libraries # paths to ROC profiler and oher libraries
export LD_LIBRARY_PATH=$PWD export LD_LIBRARY_PATH=$PWD:/opt/rocm/hip/lib
# test filter input # test filter input
test_filter=-1 test_filter=-1
@@ -33,6 +33,12 @@ if [ -n "$1" ] ; then
test_filter=$1 test_filter=$1
fi fi
# debugger
debugger=""
if [ -n "$2" ] ; then
debugger=$2
fi
# test check routin # test check routin
test_status=0 test_status=0
test_runnum=0 test_runnum=0
@@ -46,7 +52,7 @@ eval_test() {
if [ $test_filter = -1 -o $test_filter = $test_number ] ; then if [ $test_filter = -1 -o $test_filter = $test_number ] ; then
echo "$label: \"$cmdline\"" echo "$label: \"$cmdline\""
test_runnum=$((test_runnum + 1)) test_runnum=$((test_runnum + 1))
eval "$cmdline" eval "$debugger $cmdline"
if [ $? != 0 ] ; then if [ $? != 0 ] ; then
echo "$label: FAILED" echo "$label: FAILED"
test_status=$(($test_status + 1)) test_status=$(($test_status + 1))
+2 -2
Melihat File
@@ -680,6 +680,8 @@ extern "C" PUBLIC_API bool OnLoad(HsaApiTable* table, uint64_t runtime_version,
hcc_activity_file_handle = open_output_file(output_prefix, "hcc_ops_trace.txt"); hcc_activity_file_handle = open_output_file(output_prefix, "hcc_ops_trace.txt");
fprintf(stdout, " HIP-trace()\n"); fflush(stdout); fprintf(stdout, " HIP-trace()\n"); fflush(stdout);
// roctracer properties
roctracer_set_properties(ACTIVITY_DOMAIN_HIP_API, (void*)mark_api_callback);
// Allocating tracing pool // Allocating tracing pool
roctracer_properties_t properties{}; roctracer_properties_t properties{};
properties.buffer_size = 0x80000; properties.buffer_size = 0x80000;
@@ -688,8 +690,6 @@ extern "C" PUBLIC_API bool OnLoad(HsaApiTable* table, uint64_t runtime_version,
ROCTRACER_CALL(roctracer_enable_domain_activity(ACTIVITY_DOMAIN_HCC_OPS)); ROCTRACER_CALL(roctracer_enable_domain_activity(ACTIVITY_DOMAIN_HCC_OPS));
ROCTRACER_CALL(roctracer_enable_domain_activity(ACTIVITY_DOMAIN_HIP_API)); ROCTRACER_CALL(roctracer_enable_domain_activity(ACTIVITY_DOMAIN_HIP_API));
ROCTRACER_CALL(roctracer_enable_domain_callback(ACTIVITY_DOMAIN_HIP_API, hip_api_callback, NULL)); ROCTRACER_CALL(roctracer_enable_domain_callback(ACTIVITY_DOMAIN_HIP_API, hip_api_callback, NULL));
roctracer_set_properties(ACTIVITY_DOMAIN_HIP_API, (void*)mark_api_callback);
} }
const char* ctrl_str = getenv("ROCP_CTRL_RATE"); const char* ctrl_str = getenv("ROCP_CTRL_RATE");