SWDEV-431399 - add const cast to pointer before casting it to function type.

C++ does not allow const qualifier on function type, even if we add it it will get ignored and clang will fail with failed cast from const void* to func*. const_cast here is necessary to make it work.

Change-Id: I72cec8d9e715bdf9e163cb9b08393dd733dafaf2
Esse commit está contido em:
Jatin Chaudhary
2023-12-01 13:07:37 +00:00
commit de Jatin Jaikishan Chaudhary
commit 5b5213adf5
+1 -1
Ver Arquivo
@@ -48,7 +48,7 @@ const char* hipKernelNameRefByPtr(const void* host_function, hipStream_t stream)
void hipRegisterTracerCallback(const void* function) {
typedef int (*fptr)(activity_domain_t domain, uint32_t operation_id, void* data);
fptr my_fptr = reinterpret_cast<fptr>(function);
fptr my_fptr = reinterpret_cast<fptr>(const_cast<void*>(function));
activity_prof::report_activity.store(my_fptr, std::memory_order_relaxed);
}