Support for rocJPEG Tracing (#5)
* Add initial support for rocJPEG API Trace
* Added tests for rocjpeg
* Formatting
[ROCm/rocprofiler-register commit: 366716af06]
This commit is contained in:
@@ -14,6 +14,7 @@ extern "C" {
|
||||
# pragma weak roctxRangePop
|
||||
# pragma weak ncclGetVersion
|
||||
# pragma weak rocDecCreateDecoder
|
||||
# pragma weak rocJpegStreamCreate
|
||||
#endif
|
||||
|
||||
extern void
|
||||
@@ -51,6 +52,17 @@ extern rocDecStatus
|
||||
rocDecCreateDecoder(rocDecDecoderHandle* decoder_handle,
|
||||
RocDecoderCreateInfo* decoder_create_info);
|
||||
|
||||
enum RocJpegStatus
|
||||
{
|
||||
};
|
||||
|
||||
enum RocJpegStreamHandle
|
||||
{
|
||||
};
|
||||
|
||||
extern RocJpegStatus
|
||||
rocJpegStreamCreate(RocJpegStreamHandle* jpeg_stream_handle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -22,6 +22,7 @@ decltype(ncclGetVersion)* ncclGetVersion_fn = nullptr;
|
||||
decltype(roctxRangePush)* roctxRangePush_fn = nullptr;
|
||||
decltype(roctxRangePush)* roctxRangePop_fn = nullptr;
|
||||
decltype(rocDecCreateDecoder)* rocDecCreateDecoder_fn = nullptr;
|
||||
decltype(rocJpegStreamCreate)* rocJpegStreamCreate_fn = nullptr;
|
||||
|
||||
enum rocp_reg_test_modes : uint8_t
|
||||
{
|
||||
@@ -31,6 +32,7 @@ enum rocp_reg_test_modes : uint8_t
|
||||
ROCP_REG_TEST_ROCTX = (1 << 2),
|
||||
ROCP_REG_TEST_RCCL = (1 << 3),
|
||||
ROCP_REG_TEST_ROCDECODE = (1 << 4),
|
||||
ROCP_REG_TEST_ROCJPEG = (1 << 5),
|
||||
};
|
||||
|
||||
template <uint8_t Idx = ROCP_REG_TEST_NONE>
|
||||
@@ -79,6 +81,7 @@ resolve_symbols(int _open_mode = RTLD_LOCAL | RTLD_LAZY)
|
||||
void* roctx_handle = nullptr;
|
||||
void* rccl_handle = nullptr;
|
||||
void* rocdecode_handle = nullptr;
|
||||
void* rocjpeg_handle = nullptr;
|
||||
|
||||
if constexpr((Idx & ROCP_REG_TEST_HIP) == ROCP_REG_TEST_HIP)
|
||||
{
|
||||
@@ -117,5 +120,12 @@ resolve_symbols(int _open_mode = RTLD_LOCAL | RTLD_LAZY)
|
||||
if(!rocDecCreateDecoder_fn) _resolve_dlopen(rocdecode_handle, "librocdecode.so");
|
||||
_resolve_dlsym(rocDecCreateDecoder_fn, rocdecode_handle, "rocDecCreateDecoder");
|
||||
}
|
||||
|
||||
if constexpr((Idx & ROCP_REG_TEST_ROCJPEG) == ROCP_REG_TEST_ROCJPEG)
|
||||
{
|
||||
rocJpegStreamCreate_fn = rocJpegStreamCreate;
|
||||
if(!rocJpegStreamCreate_fn) _resolve_dlopen(rocjpeg_handle, "librocjpeg.so");
|
||||
_resolve_dlsym(rocJpegStreamCreate_fn, rocjpeg_handle, "rocJpegStreamCreate");
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user