rocJPEG API Tracing (#73)
* rocDecode API Tracing support * Test bin file added to rocdecode. Need to add validate python methods * Added option to not make rocDecode tests * Added rocdecode and rocprofv3 tests * Added csv test * Address PR comments. Changed tests to use built-in rocstreambit decoder to remove ffmpeg dependancy. Changed cmake option to disbale tests rather than not build them. Tests work locally, but will fail until rocDecode is built with tracing enabled on CI * Add option to avoid building rocdecode tests * Added option to avoid building rocdecode bin file * Support for rocJPEG API Trace * Added newline to rocjpeg_version.h * json-tool code added, initial test/bin commit * Formatting * Resolved rocjpeg bin test compilation errors * Tests implemented. Perfetto module currently resulting in errors, so need to retest whenever it is fixed * Formatting and compilation errors * Minor fixes * Copyright year update and minor fixes * Doc update fix * Added rocjpeg csv file in data * Addresses review comments: Updated fixed Findroc.. and uses root directory as a hint, fixed documentation error, changed tables to use _CORE, minor style fixes * Added rocdecode and rocjpeg to CI * Removed rocdecode and rocjpeg from CI and added back build tests option * Updated Cmake Files * Added rocDecode and rocJPEG to CI * Remove cmake line added in error * Temporarily modified tests to pass if rocdecode or rocjpeg tracing are not supported for CI, cmake changes * Added find_package for test * Added back use of system rocDecode and rocJPEG, modifies system files to include prefix path * Updated no-link to include INCLUDE_DIR/roc(decode|jpeg), added comments for tests * Resolve merge conflicts and formatting * Added regex find and replace instead of include for CI * VAAPI package causing errors on Vega20 * Removed system rocjpeg and rocdecode use temporarily until cmake issues resolved * Removed workflows regex * Formatting and minor test modification * Modified test for vega20 * Update rocDecode and rocJPEG cmake and tests * Changelog * Fix merge conflict * Added back if-statements around add-tests since cmake-generator-expressions are resulting in errors when the packages are missing * Removed if found statements, replaced with TARGET:EXISTS * Skip json file for rocjpeg and rocdecode tests if not supported * Add os import --------- Co-authored-by: Kandula, Venkateshwar reddy <Venkateshwarreddy.Kandula@amd.com> Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
This commit is contained in:
@@ -32,6 +32,7 @@ set(ROCPROFILER_HEADER_FILES
|
||||
registration.h
|
||||
rccl.h
|
||||
rocdecode.h
|
||||
rocjpeg.h
|
||||
spm.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/version.h)
|
||||
|
||||
@@ -46,6 +47,7 @@ add_subdirectory(marker)
|
||||
add_subdirectory(ompt)
|
||||
add_subdirectory(rccl)
|
||||
add_subdirectory(rocdecode)
|
||||
add_subdirectory(rocjpeg)
|
||||
add_subdirectory(cxx)
|
||||
add_subdirectory(kfd)
|
||||
add_subdirectory(amd_detail)
|
||||
|
||||
@@ -183,9 +183,9 @@ typedef struct
|
||||
} rocprofiler_buffer_tracing_rccl_api_record_t;
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler Buffer ROCDecode API Record.
|
||||
* @brief ROCProfiler Buffer rocDecode API Record.
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_buffer_tracing_rocdecode_api_record_t
|
||||
{
|
||||
uint64_t size; ///< size of this struct
|
||||
rocprofiler_buffer_tracing_kind_t kind;
|
||||
@@ -201,6 +201,25 @@ typedef struct
|
||||
/// @brief Specification of the API function, e.g., ::rocprofiler_rocdecode_api_id_t
|
||||
} rocprofiler_buffer_tracing_rocdecode_api_record_t;
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler Buffer rocJPEG API Record.
|
||||
*/
|
||||
typedef struct rocprofiler_buffer_tracing_rocjpeg_api_record_t
|
||||
{
|
||||
uint64_t size; ///< size of this struct
|
||||
rocprofiler_buffer_tracing_kind_t kind;
|
||||
rocprofiler_tracing_operation_t operation;
|
||||
rocprofiler_correlation_id_t correlation_id; ///< correlation ids for record
|
||||
rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
|
||||
rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
|
||||
rocprofiler_thread_id_t thread_id; ///< id for thread generating this record
|
||||
|
||||
/// @var kind
|
||||
/// @brief ::ROCPROFILER_CALLBACK_TRACING_ROCJPEG_API
|
||||
/// @var operation
|
||||
/// @brief Specification of the API function, e.g., ::rocprofiler_rocjpeg_api_id_t
|
||||
} rocprofiler_buffer_tracing_rocjpeg_api_record_t;
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler Buffer Memory Copy Tracer Record.
|
||||
*/
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <rocprofiler-sdk/ompt.h>
|
||||
#include <rocprofiler-sdk/rccl.h>
|
||||
#include <rocprofiler-sdk/rocdecode.h>
|
||||
#include <rocprofiler-sdk/rocjpeg.h>
|
||||
|
||||
#include <hsa/hsa.h>
|
||||
#include <hsa/hsa_amd_tool.h>
|
||||
@@ -110,15 +111,25 @@ typedef struct
|
||||
} rocprofiler_callback_tracing_rccl_api_data_t;
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler ROCDecode API Callback Data.
|
||||
* @brief ROCProfiler rocDecode API Callback Data.
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct rocprofiler_callback_tracing_rocdecode_api_data_t
|
||||
{
|
||||
uint64_t size; ///< size of this struct
|
||||
rocprofiler_rocdecode_api_args_t args;
|
||||
rocprofiler_rocdecode_api_retval_t retval;
|
||||
} rocprofiler_callback_tracing_rocdecode_api_data_t;
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler rocJPEG API Callback Data.
|
||||
*/
|
||||
typedef struct rocprofiler_callback_tracing_rocjpeg_api_data_t
|
||||
{
|
||||
uint64_t size; ///< size of this struct
|
||||
rocprofiler_rocjpeg_api_args_t args;
|
||||
rocprofiler_rocjpeg_api_retval_t retval;
|
||||
} rocprofiler_callback_tracing_rocjpeg_api_data_t;
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler Code Object Load Tracer Callback Record.
|
||||
*/
|
||||
|
||||
@@ -82,7 +82,8 @@ ROCPROFILER_DEFINE_CATEGORY(category, openmp, "OpenMP")
|
||||
ROCPROFILER_DEFINE_CATEGORY(category, kernel_dispatch, "GPU kernel dispatch")
|
||||
ROCPROFILER_DEFINE_CATEGORY(category, memory_copy, "Async memory copy")
|
||||
ROCPROFILER_DEFINE_CATEGORY(category, memory_allocation, "Memory Allocation")
|
||||
ROCPROFILER_DEFINE_CATEGORY(category, rocdecode_api, "ROCDecode API function")
|
||||
ROCPROFILER_DEFINE_CATEGORY(category, rocdecode_api, "rocDecode API function")
|
||||
ROCPROFILER_DEFINE_CATEGORY(category, rocjpeg_api, "rocJPEG API function")
|
||||
|
||||
#define ROCPROFILER_PERFETTO_CATEGORIES \
|
||||
ROCPROFILER_PERFETTO_CATEGORY(category::hsa_api), \
|
||||
@@ -93,7 +94,8 @@ ROCPROFILER_DEFINE_CATEGORY(category, rocdecode_api, "ROCDecode API function")
|
||||
ROCPROFILER_PERFETTO_CATEGORY(category::kernel_dispatch), \
|
||||
ROCPROFILER_PERFETTO_CATEGORY(category::memory_copy), \
|
||||
ROCPROFILER_PERFETTO_CATEGORY(category::memory_allocation), \
|
||||
ROCPROFILER_PERFETTO_CATEGORY(category::rocdecode_api)
|
||||
ROCPROFILER_PERFETTO_CATEGORY(category::rocdecode_api), \
|
||||
ROCPROFILER_PERFETTO_CATEGORY(category::rocjpeg_api)
|
||||
|
||||
#include <perfetto.h>
|
||||
|
||||
|
||||
@@ -402,6 +402,21 @@ save(ArchiveT& ar, rocprofiler_callback_tracing_rocdecode_api_data_t data)
|
||||
ROCP_SDK_SAVE_DATA_FIELD(retval);
|
||||
}
|
||||
|
||||
template <typename ArchiveT>
|
||||
void
|
||||
save(ArchiveT& ar, rocprofiler_rocjpeg_api_retval_t data)
|
||||
{
|
||||
ROCP_SDK_SAVE_DATA_FIELD(rocJpegStatus_retval);
|
||||
}
|
||||
|
||||
template <typename ArchiveT>
|
||||
void
|
||||
save(ArchiveT& ar, rocprofiler_callback_tracing_rocjpeg_api_data_t data)
|
||||
{
|
||||
ROCP_SDK_SAVE_DATA_FIELD(size);
|
||||
ROCP_SDK_SAVE_DATA_FIELD(retval);
|
||||
}
|
||||
|
||||
template <typename ArchiveT>
|
||||
void
|
||||
save(ArchiveT& ar, rocprofiler_callback_tracing_ompt_data_t data)
|
||||
@@ -502,6 +517,13 @@ save(ArchiveT& ar, rocprofiler_buffer_tracing_rocdecode_api_record_t data)
|
||||
save_buffer_tracing_api_record(ar, data);
|
||||
}
|
||||
|
||||
template <typename ArchiveT>
|
||||
void
|
||||
save(ArchiveT& ar, rocprofiler_buffer_tracing_rocjpeg_api_record_t data)
|
||||
{
|
||||
save_buffer_tracing_api_record(ar, data);
|
||||
}
|
||||
|
||||
template <typename ArchiveT>
|
||||
void
|
||||
save(ArchiveT& ar, rocprofiler_buffer_tracing_ompt_target_t data)
|
||||
|
||||
@@ -70,6 +70,7 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_OMPT, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_MEMORY_ALLOCATION, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_ROCDECODE_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_ROCJPEG_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_LAST,
|
||||
} rocprofiler_external_correlation_id_request_kind_t;
|
||||
|
||||
|
||||
@@ -177,6 +177,7 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
ROCPROFILER_CALLBACK_TRACING_RUNTIME_INITIALIZATION, ///< Callback notifying that a runtime
|
||||
///< library has been initialized
|
||||
ROCPROFILER_CALLBACK_TRACING_ROCDECODE_API, ///< rocDecode API Tracing
|
||||
ROCPROFILER_CALLBACK_TRACING_ROCJPEG_API, ///< rocJPEG API Tracing
|
||||
ROCPROFILER_CALLBACK_TRACING_LAST,
|
||||
} rocprofiler_callback_tracing_kind_t;
|
||||
|
||||
@@ -209,6 +210,7 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
///< been initialized. @see
|
||||
///< ::rocprofiler_runtime_initialization_operation_t
|
||||
ROCPROFILER_BUFFER_TRACING_ROCDECODE_API, ///< rocDecode tracing
|
||||
ROCPROFILER_BUFFER_TRACING_ROCJPEG_API, ///< rocJPEG tracing
|
||||
ROCPROFILER_BUFFER_TRACING_LAST,
|
||||
} rocprofiler_buffer_tracing_kind_t;
|
||||
|
||||
@@ -371,7 +373,8 @@ typedef enum
|
||||
ROCPROFILER_MARKER_LIBRARY = (1 << 3),
|
||||
ROCPROFILER_RCCL_LIBRARY = (1 << 4),
|
||||
ROCPROFILER_ROCDECODE_LIBRARY = (1 << 5),
|
||||
ROCPROFILER_LIBRARY_LAST = ROCPROFILER_ROCDECODE_LIBRARY,
|
||||
ROCPROFILER_ROCJPEG_LIBRARY = (1 << 6),
|
||||
ROCPROFILER_LIBRARY_LAST = ROCPROFILER_ROCJPEG_LIBRARY,
|
||||
} rocprofiler_runtime_library_t;
|
||||
|
||||
/**
|
||||
@@ -388,7 +391,8 @@ typedef enum
|
||||
ROCPROFILER_MARKER_NAME_TABLE = (1 << 5),
|
||||
ROCPROFILER_RCCL_TABLE = (1 << 6),
|
||||
ROCPROFILER_ROCDECODE_TABLE = (1 << 7),
|
||||
ROCPROFILER_TABLE_LAST = ROCPROFILER_ROCDECODE_TABLE,
|
||||
ROCPROFILER_ROCJPEG_TABLE = (1 << 8),
|
||||
ROCPROFILER_TABLE_LAST = ROCPROFILER_ROCJPEG_TABLE,
|
||||
} rocprofiler_intercept_table_t;
|
||||
|
||||
/**
|
||||
@@ -401,7 +405,8 @@ typedef enum // NOLINT(performance-enum-size)
|
||||
ROCPROFILER_RUNTIME_INITIALIZATION_HIP, ///< Application loaded HIP runtime
|
||||
ROCPROFILER_RUNTIME_INITIALIZATION_MARKER, ///< Application loaded Marker (ROCTx) runtime
|
||||
ROCPROFILER_RUNTIME_INITIALIZATION_RCCL, ///< Application loaded RCCL runtime
|
||||
ROCPROFILER_RUNTIME_INITIALIZATION_ROCDECODE, ///< Application loaded rocDecode runtime
|
||||
ROCPROFILER_RUNTIME_INITIALIZATION_ROCDECODE, ///< Application loaded rocDecoder runtime
|
||||
ROCPROFILER_RUNTIME_INITIALIZATION_ROCJPEG, ///< Application loaded rocJPEG runtime
|
||||
ROCPROFILER_RUNTIME_INITIALIZATION_LAST,
|
||||
} rocprofiler_runtime_initialization_operation_t;
|
||||
|
||||
|
||||
@@ -25,17 +25,7 @@
|
||||
#include <rocprofiler-sdk/defines.h>
|
||||
#include <rocprofiler-sdk/version.h>
|
||||
|
||||
#if !defined(ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE)
|
||||
# if defined __has_include
|
||||
# if __has_include(<rocdecode/rocparser.h>) && __has_include(<rocdecode/rocdecode.h>) && __has_include(<rocdecode/roc_bitstream_reader.h>)
|
||||
# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 1
|
||||
# else
|
||||
# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 0
|
||||
# endif
|
||||
# else
|
||||
# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 0
|
||||
# endif
|
||||
#endif
|
||||
#include <rocprofiler-sdk/rocdecode/details/rocdecode_headers.h>
|
||||
|
||||
#if ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE > 0
|
||||
# include <rocdecode/roc_bitstream_reader.h>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <rocprofiler-sdk/version.h>
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler enumeration of HSA Core API tracing operations
|
||||
* @brief ROCProfiler enumeration of rocDecode API tracing operations
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#
|
||||
#
|
||||
# Installation of public ROCDecode headers
|
||||
# Installation of public rocDecode headers
|
||||
#
|
||||
#
|
||||
set(ROCPROFILER_ROCDECODE_DETAILS_HEADER_FILES
|
||||
rocdecode_api_trace.h rocdecode.h rocparser.h rocdecode_version.h
|
||||
roc_bitstream_reader.h)
|
||||
roc_bitstream_reader.h rocdecode_headers.h)
|
||||
|
||||
install(
|
||||
FILES ${ROCPROFILER_ROCDECODE_DETAILS_HEADER_FILES}
|
||||
|
||||
@@ -22,17 +22,7 @@ THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined(ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE)
|
||||
# if defined __has_include
|
||||
# if __has_include(<rocdecode/rocdecode.h>)
|
||||
# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 1
|
||||
# else
|
||||
# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 0
|
||||
# endif
|
||||
# else
|
||||
# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 0
|
||||
# endif
|
||||
#endif
|
||||
#include <rocprofiler-sdk/rocdecode/details/rocdecode_headers.h>
|
||||
|
||||
#if ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE > 0
|
||||
# include <rocdecode/rocdecode.h>
|
||||
|
||||
@@ -31,17 +31,8 @@ THE SOFTWARE.
|
||||
#endif
|
||||
|
||||
#include "hip/hip_runtime.h"
|
||||
#if !defined(ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE)
|
||||
# if defined __has_include
|
||||
# if __has_include(<rocdecode/rocdecode_version.h>)
|
||||
# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 1
|
||||
# else
|
||||
# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 0
|
||||
# endif
|
||||
# else
|
||||
# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <rocprofiler-sdk/rocdecode/details/rocdecode_headers.h>
|
||||
|
||||
#if ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE > 0
|
||||
# include <rocdecode/rocdecode_version.h>
|
||||
|
||||
@@ -21,17 +21,7 @@ THE SOFTWARE.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#if !defined(ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE)
|
||||
# if defined __has_include
|
||||
# if __has_include(<rocdecode/rocparser.h>) && __has_include(<rocdecode/rocdecode.h>) && __has_include(<rocdecode/roc_bitstream_reader.h>)
|
||||
# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 1
|
||||
# else
|
||||
# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 0
|
||||
# endif
|
||||
# else
|
||||
# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 0
|
||||
# endif
|
||||
#endif
|
||||
#include <rocprofiler-sdk/rocdecode/details/rocdecode_headers.h>
|
||||
|
||||
#if ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE > 0
|
||||
# include <rocdecode/roc_bitstream_reader.h>
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
Copyright (c) 2024 - 2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE is set to 0 due to issues with the
|
||||
rocDecode cmake setup and header files. Once they are resolved, the first
|
||||
if-condition should set the ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE variable
|
||||
to 1
|
||||
*/
|
||||
#if !defined(ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE)
|
||||
# if defined __has_include
|
||||
# if __has_include(<rocdecode/rocdecode.h>)
|
||||
# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 0
|
||||
# else
|
||||
# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 0
|
||||
# endif
|
||||
# else
|
||||
# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 0
|
||||
# endif
|
||||
#endif
|
||||
@@ -22,17 +22,7 @@ THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined(ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE)
|
||||
# if defined __has_include
|
||||
# if __has_include(<rocdecode/rocdecode.h>)
|
||||
# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 1
|
||||
# else
|
||||
# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 0
|
||||
# endif
|
||||
# else
|
||||
# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 0
|
||||
# endif
|
||||
#endif
|
||||
#include <rocprofiler-sdk/rocdecode/details/rocdecode_headers.h>
|
||||
|
||||
#if ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE > 0
|
||||
# include <rocdecode/rocdecode.h>
|
||||
|
||||
@@ -26,6 +26,6 @@
|
||||
typedef enum
|
||||
{
|
||||
ROCPROFILER_ROCDECODE_TABLE_ID_NONE = -1,
|
||||
ROCPROFILER_ROCDECODE_TABLE_ID = 0,
|
||||
ROCPROFILER_ROCDECODE_TABLE_ID_CORE = 0,
|
||||
ROCPROFILER_ROCDECODE_TABLE_ID_LAST,
|
||||
} rocprofiler_rocdecode_table_id_t;
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
// MIT License
|
||||
//
|
||||
// Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/rocjpeg/api_args.h>
|
||||
#include <rocprofiler-sdk/rocjpeg/api_id.h>
|
||||
#include <rocprofiler-sdk/rocjpeg/table_id.h>
|
||||
@@ -0,0 +1,13 @@
|
||||
#
|
||||
#
|
||||
# Installation of public rocJPEG headers
|
||||
#
|
||||
#
|
||||
set(ROCPROFILER_ROCJPEG_HEADER_FILES api_args.h api_id.h table_id.h)
|
||||
|
||||
install(
|
||||
FILES ${ROCPROFILER_ROCJPEG_HEADER_FILES}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler-sdk/rocjpeg
|
||||
COMPONENT development)
|
||||
|
||||
add_subdirectory(details)
|
||||
@@ -0,0 +1,118 @@
|
||||
// MIT License
|
||||
//
|
||||
// Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/defines.h>
|
||||
#include <rocprofiler-sdk/version.h>
|
||||
|
||||
#include <rocprofiler-sdk/rocjpeg/details/rocjpeg_headers.h>
|
||||
|
||||
#if ROCPROFILER_SDK_USE_SYSTEM_ROCJPEG > 0
|
||||
# include <rocjpeg/rocjpeg.h>
|
||||
#else
|
||||
# include <rocprofiler-sdk/rocjpeg/details/rocjpeg.h>
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
ROCPROFILER_EXTERN_C_INIT
|
||||
|
||||
// Empty struct has a size of 0 in C but size of 1 in C++.
|
||||
// This struct is added to the union members which represent
|
||||
// functions with no arguments to ensure ABI compatibility
|
||||
typedef struct rocprofiler_rocjpeg_api_no_args
|
||||
{
|
||||
char empty;
|
||||
} rocprofiler_rocjpeg_api_no_args;
|
||||
|
||||
typedef union rocprofiler_rocjpeg_api_retval_t
|
||||
{
|
||||
int32_t rocJpegStatus_retval;
|
||||
const char* const_charp_retval;
|
||||
} rocprofiler_rocjpeg_api_retval_t;
|
||||
|
||||
typedef union rocprofiler_rocjpeg_api_args_t
|
||||
{
|
||||
struct
|
||||
{
|
||||
RocJpegStreamHandle* jpeg_stream_handle;
|
||||
} rocJpegStreamCreate;
|
||||
|
||||
struct
|
||||
{
|
||||
const unsigned char* data;
|
||||
size_t length;
|
||||
RocJpegStreamHandle jpeg_stream_handle;
|
||||
} rocJpegStreamParse;
|
||||
|
||||
struct
|
||||
{
|
||||
RocJpegStreamHandle jpeg_stream_handle;
|
||||
} rocJpegStreamDestroy;
|
||||
|
||||
struct
|
||||
{
|
||||
RocJpegBackend backend;
|
||||
int device_id;
|
||||
RocJpegHandle* handle;
|
||||
} rocJpegCreate;
|
||||
|
||||
struct
|
||||
{
|
||||
RocJpegHandle handle;
|
||||
} rocJpegDestroy;
|
||||
|
||||
struct
|
||||
{
|
||||
RocJpegHandle handle;
|
||||
RocJpegStreamHandle jpeg_stream_handle;
|
||||
uint8_t* num_components;
|
||||
RocJpegChromaSubsampling* subsampling;
|
||||
uint32_t* widths;
|
||||
uint32_t* heights;
|
||||
} rocJpegGetImageInfo;
|
||||
|
||||
struct
|
||||
{
|
||||
RocJpegHandle handle;
|
||||
RocJpegStreamHandle jpeg_stream_handle;
|
||||
const RocJpegDecodeParams* decode_params;
|
||||
RocJpegImage* destination;
|
||||
} rocJpegDecode;
|
||||
|
||||
struct
|
||||
{
|
||||
RocJpegHandle handle;
|
||||
RocJpegStreamHandle* jpeg_stream_handles;
|
||||
int batch_size;
|
||||
const RocJpegDecodeParams* decode_params;
|
||||
RocJpegImage* destinations;
|
||||
} rocJpegDecodeBatched;
|
||||
|
||||
struct
|
||||
{
|
||||
RocJpegStatus rocjpeg_status;
|
||||
} rocJpegGetErrorName;
|
||||
} rocprofiler_rocjpeg_api_args_t;
|
||||
|
||||
ROCPROFILER_EXTERN_C_FINI
|
||||
@@ -0,0 +1,45 @@
|
||||
// MIT License
|
||||
//
|
||||
// Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/version.h>
|
||||
|
||||
/**
|
||||
* @brief ROCProfiler enumeration of rocJPEG API tracing operations
|
||||
*/
|
||||
typedef enum // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_ROCJPEG_API_ID_NONE = -1,
|
||||
|
||||
ROCPROFILER_ROCJPEG_API_ID_rocJpegStreamCreate = 0,
|
||||
ROCPROFILER_ROCJPEG_API_ID_rocJpegStreamParse,
|
||||
ROCPROFILER_ROCJPEG_API_ID_rocJpegStreamDestroy,
|
||||
ROCPROFILER_ROCJPEG_API_ID_rocJpegCreate,
|
||||
ROCPROFILER_ROCJPEG_API_ID_rocJpegDestroy,
|
||||
ROCPROFILER_ROCJPEG_API_ID_rocJpegGetImageInfo,
|
||||
ROCPROFILER_ROCJPEG_API_ID_rocJpegDecode,
|
||||
ROCPROFILER_ROCJPEG_API_ID_rocJpegDecodeBatched,
|
||||
ROCPROFILER_ROCJPEG_API_ID_rocJpegGetErrorName,
|
||||
|
||||
ROCPROFILER_ROCJPEG_API_ID_LAST,
|
||||
} rocprofiler_rocjpef_api_id_t;
|
||||
@@ -0,0 +1,12 @@
|
||||
#
|
||||
#
|
||||
# Installation of public rocJPEG headers
|
||||
#
|
||||
#
|
||||
set(ROCPROFILER_ROCJPEG_DETAILS_HEADER_FILES rocjpeg_api_trace.h rocjpeg.h
|
||||
rocjpeg_version.h rocjpeg_headers.h)
|
||||
|
||||
install(
|
||||
FILES ${ROCPROFILER_ROCJPEG_DETAILS_HEADER_FILES}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocprofiler-sdk/rocjpeg/details
|
||||
COMPONENT development)
|
||||
@@ -0,0 +1,418 @@
|
||||
/* Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef ROC_JPEG_H
|
||||
#define ROC_JPEG_H
|
||||
|
||||
#define ROCJPEGAPI
|
||||
|
||||
#pragma once
|
||||
#include <rocprofiler-sdk/rocjpeg/details/rocjpeg_headers.h>
|
||||
#include "hip/hip_runtime.h"
|
||||
|
||||
#if ROCPROFILER_SDK_USE_SYSTEM_ROCJPEG > 0
|
||||
# include <rocjpeg/rocjpeg_version.h>
|
||||
#else
|
||||
# include <rocprofiler-sdk/rocjpeg/details/rocjpeg_version.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file rocjpeg.h
|
||||
* @brief The AMD rocJPEG Library.
|
||||
* @defgroup group_amd_rocjepg rocJPEG: AMD ROCm JPEG Decode API
|
||||
* @brief rocJPEG API is a toolkit to decode JPEG images using a hardware-accelerated JPEG decoder
|
||||
* on AMD’s GPUs.
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
/**
|
||||
* @def
|
||||
* @ingroup group_amd_rocjpeg
|
||||
* Maximum number of channels rocJPEG supports
|
||||
*/
|
||||
#define ROCJPEG_MAX_COMPONENT 4
|
||||
|
||||
/**
|
||||
* @enum RocJpegStatus
|
||||
* @ingroup group_amd_rocjpeg
|
||||
* @brief Enumeration representing the status codes for the rocJPEG library.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
ROCJPEG_STATUS_SUCCESS = 0, /**< The operation completed successfully. */
|
||||
ROCJPEG_STATUS_NOT_INITIALIZED = -1, /**< The rocJPEG library is not initialized. */
|
||||
ROCJPEG_STATUS_INVALID_PARAMETER = -2, /**< An invalid parameter was passed to a function. */
|
||||
ROCJPEG_STATUS_BAD_JPEG = -3, /**< The input JPEG data is corrupted or invalid. */
|
||||
ROCJPEG_STATUS_JPEG_NOT_SUPPORTED = -4, /**< The JPEG format is not supported. */
|
||||
ROCJPEG_STATUS_OUTOF_MEMORY = -5, /**< Out of memory error. */
|
||||
ROCJPEG_STATUS_EXECUTION_FAILED = -6, /**< The execution of a function failed. */
|
||||
ROCJPEG_STATUS_ARCH_MISMATCH = -7, /**< The architecture is not supported. */
|
||||
ROCJPEG_STATUS_INTERNAL_ERROR = -8, /**< Internal error occurred. */
|
||||
ROCJPEG_STATUS_IMPLEMENTATION_NOT_SUPPORTED =
|
||||
-9, /**< The requested implementation is not supported. */
|
||||
ROCJPEG_STATUS_HW_JPEG_DECODER_NOT_SUPPORTED =
|
||||
-10, /**< Hardware JPEG decoder is not supported. */
|
||||
ROCJPEG_STATUS_RUNTIME_ERROR = -11, /**< Runtime error occurred. */
|
||||
ROCJPEG_STATUS_NOT_IMPLEMENTED = -12, /**< The requested feature is not implemented. */
|
||||
} RocJpegStatus;
|
||||
|
||||
/**
|
||||
* @enum RocJpegChromaSubsampling
|
||||
* @ingroup group_amd_rocjpeg
|
||||
* @brief Enum representing the chroma subsampling options for JPEG encoding/decoding.
|
||||
*
|
||||
* The `RocJpegChromaSubsampling` enum defines the available chroma subsampling options for JPEG
|
||||
* encoding/decoding. Chroma subsampling refers to the reduction of color information in an image to
|
||||
* reduce file size.
|
||||
*
|
||||
* The possible values are:
|
||||
* - `ROCJPEG_CSS_444`: Full chroma resolution (4:4:4).
|
||||
* - `ROCJPEG_CSS_440`: Chroma resolution reduced by half vertically (4:4:0).
|
||||
* - `ROCJPEG_CSS_422`: Chroma resolution reduced by half horizontally (4:2:2).
|
||||
* - `ROCJPEG_CSS_420`: Chroma resolution reduced by half both horizontally and vertically (4:2:0).
|
||||
* - `ROCJPEG_CSS_411`: Chroma resolution reduced by a quarter horizontally (4:1:1).
|
||||
* - `ROCJPEG_CSS_400`: No chroma information (4:0:0).
|
||||
* - `ROCJPEG_CSS_UNKNOWN`: Unknown chroma subsampling.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
ROCJPEG_CSS_444 = 0,
|
||||
ROCJPEG_CSS_440 = 1,
|
||||
ROCJPEG_CSS_422 = 2,
|
||||
ROCJPEG_CSS_420 = 3,
|
||||
ROCJPEG_CSS_411 = 4,
|
||||
ROCJPEG_CSS_400 = 5,
|
||||
ROCJPEG_CSS_UNKNOWN = -1
|
||||
} RocJpegChromaSubsampling;
|
||||
|
||||
/**
|
||||
* @struct RocJpegImage
|
||||
* @ingroup group_amd_rocjpeg
|
||||
* @brief Structure representing a JPEG image.
|
||||
*
|
||||
* This structure holds the information about a JPEG image, including the pointers to the image
|
||||
* channels and the pitch (stride) of each channel.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t* channel[ROCJPEG_MAX_COMPONENT]; /**< Pointers to the image channels. */
|
||||
uint32_t pitch[ROCJPEG_MAX_COMPONENT]; /**< Pitch (stride) of each channel. */
|
||||
} RocJpegImage;
|
||||
|
||||
/**
|
||||
* @enum RocJpegOutputFormat
|
||||
* @ingroup group_amd_rocjpeg
|
||||
* @brief Enum representing the output format options for the RocJpegImage.
|
||||
*
|
||||
* The `RocJpegOutputFormat` enum specifies the different output formats that can be used when
|
||||
* decoding a JPEG image using the VCN JPEG decoder.
|
||||
*
|
||||
* The available output formats are:
|
||||
* - `ROCJPEG_OUTPUT_NATIVE`: Returns the native unchanged decoded YUV image from the VCN JPEG
|
||||
* decoder. The channel arrangement depends on the chroma subsampling format.
|
||||
* - `ROCJPEG_OUTPUT_YUV_PLANAR`: Extracts the Y, U, and V channels from the decoded YUV image and
|
||||
* writes them into separate channels of the RocJpegImage.
|
||||
* - `ROCJPEG_OUTPUT_Y`: Returns only the luma component (Y) and writes it to the first channel of
|
||||
* the RocJpegImage.
|
||||
* - `ROCJPEG_OUTPUT_RGB`: Converts the decoded image to interleaved RGB format using the VCN JPEG
|
||||
* decoder or HIP kernels and writes it to the first channel of the RocJpegImage.
|
||||
* - `ROCJPEG_OUTPUT_RGB_PLANAR`: Converts the decoded image to RGB PLANAR format using the VCN JPEG
|
||||
* decoder or HIP kernels and writes the RGB channels to separate channels of the RocJpegImage.
|
||||
* - `ROCJPEG_OUTPUT_FORMAT_MAX`: Maximum allowed value for the output format.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
/**< return native unchanged decoded YUV image from the VCN JPEG decoder.
|
||||
For ROCJPEG_CSS_444 and ROCJPEG_CSS_440 write Y, U, and V to first, second, and third
|
||||
channels of RocJpegImage For ROCJPEG_CSS_422 write YUYV (packed) to first channel of
|
||||
RocJpegImage For ROCJPEG_CSS_420 write Y to first channel and UV (interleaved) to second
|
||||
channel of RocJpegImage For ROCJPEG_CSS_400 write Y to first channel of RocJpegImage */
|
||||
ROCJPEG_OUTPUT_NATIVE = 0,
|
||||
/**< extract Y, U, and V channels from the decoded YUV image from the VCN JPEG decoder and write
|
||||
into first, second, and third channel of RocJpegImage. For ROCJPEG_CSS_400 write Y to first
|
||||
channel of RocJpegImage */
|
||||
ROCJPEG_OUTPUT_YUV_PLANAR = 1,
|
||||
/**< return luma component (Y) and write to first channel of RocJpegImage */
|
||||
ROCJPEG_OUTPUT_Y = 2,
|
||||
/**< convert to interleaved RGB using VCN JPEG decoder (on MI300+) or using HIP kernels and
|
||||
write to first channel of RocJpegImage */
|
||||
ROCJPEG_OUTPUT_RGB = 3,
|
||||
/**< convert to RGB PLANAR using VCN JPEG decoder (on MI300+) or HIP kernels and write to first,
|
||||
second, and third channel of RocJpegImage. */
|
||||
ROCJPEG_OUTPUT_RGB_PLANAR = 4,
|
||||
ROCJPEG_OUTPUT_FORMAT_MAX = 5 /**< maximum allowed value */
|
||||
} RocJpegOutputFormat;
|
||||
|
||||
/**
|
||||
* @struct RocJpegDecodeParams
|
||||
* @ingroup group_amd_rocjpeg
|
||||
* @brief Structure containing parameters for JPEG decoding.
|
||||
*
|
||||
* This structure defines the parameters for decoding a JPEG image using the rocJpeg library.
|
||||
* It specifies the output format, crop rectangle, and target dimensions for the decoded image.
|
||||
* Note that if both the crop rectangle and target dimensions are defined, cropping is done first,
|
||||
* followed by resizing the resulting ROI to the target dimension.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
RocJpegOutputFormat
|
||||
output_format; /**< Output data format. See RocJpegOutputFormat for description. */
|
||||
struct
|
||||
{
|
||||
int16_t left; /**< Left coordinate of the crop rectangle. */
|
||||
int16_t top; /**< Top coordinate of the crop rectangle. */
|
||||
int16_t right; /**< Right coordinate of the crop rectangle. */
|
||||
int16_t bottom; /**< Bottom coordinate of the crop rectangle. */
|
||||
} crop_rectangle; /**< Defines the region of interest (ROI) to be copied into the RocJpegImage
|
||||
output buffers. */
|
||||
struct
|
||||
{
|
||||
uint32_t width; /**< Target width of the picture to be resized. */
|
||||
uint32_t height; /**< Target height of the picture to be resized. */
|
||||
} target_dimension; /**< (future use) Defines the target width and height of the picture to be
|
||||
resized. Both should be even. If specified, allocate the RocJpegImage
|
||||
buffers based on these dimensions. */
|
||||
} RocJpegDecodeParams;
|
||||
|
||||
/**
|
||||
* @enum RocJpegBackend
|
||||
* @ingroup group_amd_rocjpeg
|
||||
* @brief The backend options for the rocJpeg library.
|
||||
*
|
||||
* This enum defines the available backend options for the rocJpeg library.
|
||||
* The backend can be either hardware or hybrid.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
ROCJPEG_BACKEND_HARDWARE = 0, /**< Hardware backend option. */
|
||||
ROCJPEG_BACKEND_HYBRID = 1 /**< Hybrid backend option. */
|
||||
} RocJpegBackend;
|
||||
|
||||
/**
|
||||
* @brief A handle representing a RocJpegStream instance.
|
||||
*
|
||||
* The `RocJpegStreamHandle` is a pointer type used to represent a RocJpegStream instance.
|
||||
* It is used as a handle to parse and store various parameters from a JPEG stream.
|
||||
*/
|
||||
typedef void* RocJpegStreamHandle;
|
||||
|
||||
/**
|
||||
* @fn RocJpegStatus ROCJPEGAPI rocJpegStreamCreate(RocJpegStreamHandle *jpeg_stream_handle);
|
||||
* @ingroup group_amd_rocjpeg
|
||||
* @brief Creates a RocJpegStreamHandle for JPEG stream processing.
|
||||
*
|
||||
* This function creates a RocJpegStreamHandle, which is used for processing JPEG streams.
|
||||
* The created handle is stored in the `jpeg_stream_handle` parameter.
|
||||
*
|
||||
* @param jpeg_stream_handle Pointer to a RocJpegStreamHandle variable that will hold the created
|
||||
* handle.
|
||||
* @return RocJpegStatus Returns the status of the operation. Possible values are:
|
||||
* - ROCJPEG_STATUS_SUCCESS: The operation was successful.
|
||||
* - ROCJPEG_STATUS_INVALID_ARGUMENT: The `jpeg_stream_handle` parameter is
|
||||
* NULL.
|
||||
* - ROCJPEG_STATUS_OUT_OF_MEMORY: Failed to allocate memory for the handle.
|
||||
* - ROCJPEG_STATUS_UNKNOWN_ERROR: An unknown error occurred.
|
||||
*/
|
||||
RocJpegStatus ROCJPEGAPI
|
||||
rocJpegStreamCreate(RocJpegStreamHandle* jpeg_stream_handle);
|
||||
|
||||
/**
|
||||
* @fn RocJpegStatus ROCJPEGAPI rocJpegStreamParse(const unsigned char *data, size_t length,
|
||||
* RocJpegStreamHandle jpeg_stream_handle);
|
||||
* @ingroup group_amd_rocjpeg
|
||||
* @brief Parses a JPEG stream.
|
||||
*
|
||||
* This function parses a JPEG stream represented by the `data` parameter of length `length`.
|
||||
* The parsed stream is associated with the `jpeg_stream_handle` provided.
|
||||
*
|
||||
* @param data The pointer to the JPEG stream data.
|
||||
* @param length The length of the JPEG stream data.
|
||||
* @param jpeg_stream_handle The handle to the JPEG stream.
|
||||
* @return The status of the JPEG stream parsing operation.
|
||||
*/
|
||||
RocJpegStatus ROCJPEGAPI
|
||||
rocJpegStreamParse(const unsigned char* data,
|
||||
size_t length,
|
||||
RocJpegStreamHandle jpeg_stream_handle);
|
||||
|
||||
/**
|
||||
* @fn RocJpegStatus ROCJPEGAPI rocJpegStreamDestroy(RocJpegStreamHandle jpeg_stream_handle);
|
||||
* @ingroup group_amd_rocjpeg
|
||||
* @brief Destroys a RocJpegStreamHandle object and releases associated resources.
|
||||
*
|
||||
* This function destroys the RocJpegStreamHandle object specified by `jpeg_stream_handle` and
|
||||
* releases any resources associated with it. After calling this function, the `jpeg_stream_handle`
|
||||
* becomes invalid and should not be used anymore.
|
||||
*
|
||||
* @param jpeg_stream_handle The handle to the RocJpegStreamHandle object to be destroyed.
|
||||
* @return The status of the operation. Returns ROCJPEG_STATUS_SUCCESS if the operation is
|
||||
* successful, or an error code if an error occurs.
|
||||
*/
|
||||
RocJpegStatus ROCJPEGAPI
|
||||
rocJpegStreamDestroy(RocJpegStreamHandle jpeg_stream_handle);
|
||||
|
||||
/**
|
||||
* @brief A handle representing a RocJpeg instance.
|
||||
*
|
||||
* The `RocJpegHandle` is a pointer type used to represent a RocJpeg instance.
|
||||
* It is used as a handle to perform various operations on the rocJpeg library.
|
||||
*/
|
||||
typedef void* RocJpegHandle;
|
||||
|
||||
/**
|
||||
* @fn RocJpegStatus ROCJPEGAPI rocJpegCreate(RocJpegBackend backend, int device_id, RocJpegHandle
|
||||
* *handle);
|
||||
* @ingroup group_amd_rocjpeg
|
||||
* @brief Creates a RocJpegHandle for JPEG decoding.
|
||||
*
|
||||
* This function creates a RocJpegHandle for JPEG decoding using the specified backend and device
|
||||
* ID.
|
||||
*
|
||||
* @param backend The backend to be used for JPEG decoding.
|
||||
* @param device_id The ID of the device to be used for JPEG decoding.
|
||||
* @param handle Pointer to a RocJpegHandle variable to store the created handle.
|
||||
* @return The status of the operation. Returns ROCJPEG_STATUS_INVALID_PARAMETER if handle is
|
||||
* nullptr, ROCJPEG_STATUS_NOT_INITIALIZED if the rocJPEG handle initialization fails, or the status
|
||||
* returned by the InitializeDecoder function of the rocjpeg_decoder.
|
||||
*/
|
||||
RocJpegStatus ROCJPEGAPI
|
||||
rocJpegCreate(RocJpegBackend backend, int device_id, RocJpegHandle* handle);
|
||||
|
||||
/**
|
||||
* @fn RocJpegStatus ROCJPEGAPI rocJpegDestroy(RocJpegHandle handle);
|
||||
* @ingroup group_amd_rocjpeg
|
||||
* @brief Destroys a RocJpegHandle object.
|
||||
*
|
||||
* This function destroys the RocJpegHandle object pointed to by the given handle.
|
||||
* It releases any resources associated with the handle and frees the memory.
|
||||
*
|
||||
* @param handle The handle to the RocJpegHandle object to be destroyed.
|
||||
* @return The status of the operation. Returns ROCJPEG_STATUS_SUCCESS if the handle was
|
||||
* successfully destroyed, or ROCJPEG_STATUS_INVALID_PARAMETER if the handle is nullptr.
|
||||
*/
|
||||
|
||||
RocJpegStatus ROCJPEGAPI
|
||||
rocJpegDestroy(RocJpegHandle handle);
|
||||
|
||||
/**
|
||||
* @fn RocJpegStatus ROCJPEGAPI rocJpegGetImageInfo(RocJpegHandle handle, RocJpegStreamHandle
|
||||
* jpeg_stream_handle, uint8_t *num_components, RocJpegChromaSubsampling *subsampling, uint32_t
|
||||
* *widths, uint32_t *heights);
|
||||
* @ingroup group_amd_rocjpeg
|
||||
* @brief Retrieves information about the JPEG image.
|
||||
*
|
||||
* This function retrieves the number of components, chroma subsampling, and dimensions (width and
|
||||
* height) of the JPEG image specified by the `jpeg_stream_handle`. The information is stored in the
|
||||
* provided output parameters `num_components`, `subsampling`, `widths`, and `heights`.
|
||||
*
|
||||
* @param handle The handle to the RocJpegDecoder instance.
|
||||
* @param jpeg_stream_handle The handle to the RocJpegStream instance representing the JPEG image.
|
||||
* @param num_components A pointer to an unsigned 8-bit integer that will store the number of
|
||||
* components in the JPEG image.
|
||||
* @param subsampling A pointer to a RocJpegChromaSubsampling enum that will store the chroma
|
||||
* subsampling information.
|
||||
* @param widths A pointer to an unsigned 32-bit integer array that will store the width of each
|
||||
* component in the JPEG image.
|
||||
* @param heights A pointer to an unsigned 32-bit integer array that will store the height of each
|
||||
* component in the JPEG image.
|
||||
*
|
||||
* @return The RocJpegStatus indicating the success or failure of the operation.
|
||||
* - ROCJPEG_STATUS_SUCCESS: The operation was successful.
|
||||
* - ROCJPEG_STATUS_INVALID_PARAMETER: One or more input parameters are invalid.
|
||||
* - ROCJPEG_STATUS_RUNTIME_ERROR: An exception occurred during the operation.
|
||||
*/
|
||||
RocJpegStatus ROCJPEGAPI
|
||||
rocJpegGetImageInfo(RocJpegHandle handle,
|
||||
RocJpegStreamHandle jpeg_stream_handle,
|
||||
uint8_t* num_components,
|
||||
RocJpegChromaSubsampling* subsampling,
|
||||
uint32_t* widths,
|
||||
uint32_t* heights);
|
||||
|
||||
/**
|
||||
* @fn RocJpegStatus ROCJPEGAPI rocJpegDecode(RocJpegHandle handle, RocJpegStreamHandle
|
||||
* jpeg_stream_handle, const RocJpegDecodeParams *decode_params, RocJpegImage *destination);
|
||||
* @ingroup group_amd_rocjpeg
|
||||
* @brief Decodes a JPEG image using the rocJPEG library.
|
||||
*
|
||||
* This function decodes a JPEG image using the rocJPEG library. It takes a rocJpegHandle, a
|
||||
* rocJpegStreamHandle, a pointer to RocJpegDecodeParams, and a pointer to RocJpegImage as input
|
||||
* parameters. The function returns a RocJpegStatus indicating the success or failure of the
|
||||
* decoding operation.
|
||||
*
|
||||
* @param handle The rocJpegHandle representing the rocJPEG decoder instance.
|
||||
* @param jpeg_stream_handle The rocJpegStreamHandle representing the input JPEG stream.
|
||||
* @param decode_params A pointer to RocJpegDecodeParams containing the decoding parameters.
|
||||
* @param destination A pointer to RocJpegImage where the decoded image will be stored.
|
||||
* @return A RocJpegStatus indicating the success or failure of the decoding operation.
|
||||
*/
|
||||
|
||||
RocJpegStatus ROCJPEGAPI
|
||||
rocJpegDecode(RocJpegHandle handle,
|
||||
RocJpegStreamHandle jpeg_stream_handle,
|
||||
const RocJpegDecodeParams* decode_params,
|
||||
RocJpegImage* destination);
|
||||
|
||||
/**
|
||||
* @fn RocJpegStatus ROCJPEGAPI rocJpegDecodeBatched(RocJpegHandle handle, RocJpegStreamHandle
|
||||
* *jpeg_stream_handles, int batch_size, const RocJpegDecodeParams *decode_params, RocJpegImage
|
||||
* *destinations);
|
||||
* @ingroup group_amd_rocjpeg
|
||||
* @brief Decodes a batch of JPEG images using the rocJPEG library.
|
||||
*
|
||||
* Decodes a batch of JPEG images using the rocJPEG library.
|
||||
*
|
||||
* @param handle The rocJPEG handle.
|
||||
* @param jpeg_stream_handles An array of rocJPEG stream handles representing the input JPEG
|
||||
* streams.
|
||||
* @param batch_size The number of JPEG streams in the batch.
|
||||
* @param decode_params The decode parameters for the JPEG decoding process.
|
||||
* @param destinations An array of rocJPEG images representing the output decoded images.
|
||||
* @return The status of the JPEG decoding operation.
|
||||
*/
|
||||
RocJpegStatus ROCJPEGAPI
|
||||
rocJpegDecodeBatched(RocJpegHandle handle,
|
||||
RocJpegStreamHandle* jpeg_stream_handles,
|
||||
int batch_size,
|
||||
const RocJpegDecodeParams* decode_params,
|
||||
RocJpegImage* destinations);
|
||||
|
||||
/**
|
||||
* @fn extern const char* ROCDECAPI rocJpegGetErrorName(RocJpegStatus rocjpeg_status);
|
||||
* @ingroup group_amd_rocjpeg
|
||||
* @brief Retrieves the name of the error associated with the given RocJpegStatus.
|
||||
*
|
||||
* This function returns a string representation of the error associated with the given
|
||||
* RocJpegStatus.
|
||||
*
|
||||
* @param rocjpeg_status The RocJpegStatus for which to retrieve the error name.
|
||||
* @return A pointer to a constant character string representing the error name.
|
||||
*/
|
||||
extern const char* ROCJPEGAPI
|
||||
rocJpegGetErrorName(RocJpegStatus rocjpeg_status);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // ROC_JPEG_H
|
||||
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
Copyright (c) 2024 - 2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/rocjpeg/details/rocjpeg_headers.h>
|
||||
|
||||
#if ROCPROFILER_SDK_USE_SYSTEM_ROCJPEG > 0
|
||||
# include <rocjpeg/rocjpeg.h>
|
||||
#else
|
||||
# include <rocprofiler-sdk/rocjpeg/details/rocjpeg.h>
|
||||
#endif
|
||||
|
||||
// Define version macros for the rocJPEG API dispatch table, specifying the MAJOR and STEP versions.
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
//
|
||||
// 1. When adding new functions to the rocJPEG API dispatch table, always append the new function
|
||||
// pointer
|
||||
// to the end of the table and increment the dispatch table's version number. Never rearrange the
|
||||
// order of the member variables in the dispatch table, as doing so will break the Application
|
||||
// Binary Interface (ABI).
|
||||
// 2. In critical situations where the type of an existing member variable in a dispatch table has
|
||||
// been changed
|
||||
// or removed due to a data type modification, it is important to increment the major version
|
||||
// number of the rocJPEG API dispatch table. If the function pointer type can no longer be
|
||||
// declared, do not remove it. Instead, change the function pointer type to `void*` and ensure it
|
||||
// is always initialized to `nullptr`.
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
//
|
||||
|
||||
// The major version number should ideally remain unchanged. Increment the
|
||||
// ROCJPEG_RUNTIME_API_TABLE_MAJOR_VERSION only for fundamental changes to the rocJPEGDispatchTable
|
||||
// struct, such as altering the type or name of an existing member variable. Please DO NOT REMOVE
|
||||
// it.
|
||||
#define ROCJPEG_RUNTIME_API_TABLE_MAJOR_VERSION 0
|
||||
|
||||
// Increment the ROCJPEG_RUNTIME_API_TABLE_STEP_VERSION when new runtime API functions are added.
|
||||
// If the corresponding ROCJPEG_RUNTIME_API_TABLE_MAJOR_VERSION increases reset the
|
||||
// ROCJPEG_RUNTIME_API_TABLE_STEP_VERSION to zero.
|
||||
#define ROCJPEG_RUNTIME_API_TABLE_STEP_VERSION 0
|
||||
|
||||
// rocJPEG API interface
|
||||
typedef RocJpegStatus(ROCJPEGAPI* PfnRocJpegStreamCreate)(RocJpegStreamHandle* jpeg_stream_handle);
|
||||
typedef RocJpegStatus(ROCJPEGAPI* PfnRocJpegStreamParse)(const unsigned char* data,
|
||||
size_t length,
|
||||
RocJpegStreamHandle jpeg_stream_handle);
|
||||
typedef RocJpegStatus(ROCJPEGAPI* PfnRocJpegStreamDestroy)(RocJpegStreamHandle jpeg_stream_handle);
|
||||
typedef RocJpegStatus(ROCJPEGAPI* PfnRocJpegCreate)(RocJpegBackend backend,
|
||||
int device_id,
|
||||
RocJpegHandle* handle);
|
||||
typedef RocJpegStatus(ROCJPEGAPI* PfnRocJpegDestroy)(RocJpegHandle handle);
|
||||
typedef RocJpegStatus(ROCJPEGAPI* PfnRocJpegGetImageInfo)(RocJpegHandle handle,
|
||||
RocJpegStreamHandle jpeg_stream_handle,
|
||||
uint8_t* num_components,
|
||||
RocJpegChromaSubsampling* subsampling,
|
||||
uint32_t* widths,
|
||||
uint32_t* heights);
|
||||
typedef RocJpegStatus(ROCJPEGAPI* PfnRocJpegDecode)(RocJpegHandle handle,
|
||||
RocJpegStreamHandle jpeg_stream_handle,
|
||||
const RocJpegDecodeParams* decode_params,
|
||||
RocJpegImage* destination);
|
||||
typedef RocJpegStatus(ROCJPEGAPI* PfnRocJpegDecodeBatched)(RocJpegHandle handle,
|
||||
RocJpegStreamHandle* jpeg_stream_handles,
|
||||
int batch_size,
|
||||
const RocJpegDecodeParams* decode_params,
|
||||
RocJpegImage* destinations);
|
||||
typedef const char*(ROCJPEGAPI* PfnRocJpegGetErrorName)(RocJpegStatus rocjpeg_status);
|
||||
|
||||
// rocJPEG API dispatch table
|
||||
struct RocJpegDispatchTable
|
||||
{
|
||||
// ROCJPEG_RUNTIME_API_TABLE_STEP_VERSION == 0
|
||||
size_t size;
|
||||
PfnRocJpegStreamCreate pfn_rocjpeg_stream_create;
|
||||
PfnRocJpegStreamParse pfn_rocjpeg_stream_parse;
|
||||
PfnRocJpegStreamDestroy pfn_rocjpeg_stream_destroy;
|
||||
PfnRocJpegCreate pfn_rocjpeg_create;
|
||||
PfnRocJpegDestroy pfn_rocjpeg_destroy;
|
||||
PfnRocJpegGetImageInfo pfn_rocjpeg_get_image_info;
|
||||
PfnRocJpegDecode pfn_rocjpeg_decode;
|
||||
PfnRocJpegDecodeBatched pfn_rocjpeg_decode_batched;
|
||||
PfnRocJpegGetErrorName pfn_rocjpeg_get_error_name;
|
||||
|
||||
// PLEASE DO NOT EDIT ABOVE!
|
||||
// ROCJPEG_RUNTIME_API_TABLE_STEP_VERSION == 1
|
||||
|
||||
// *******************************************************************************************
|
||||
// //
|
||||
// READ BELOW
|
||||
// *******************************************************************************************
|
||||
// // Please keep this text at the end of the structure:
|
||||
|
||||
// 1. Do not reorder any existing members.
|
||||
// 2. Increase the step version definition before adding new members.
|
||||
// 3. Insert new members under the appropriate step version comment.
|
||||
// 4. Generate a comment for the next step version.
|
||||
// 5. Add a "PLEASE DO NOT EDIT ABOVE!" comment.
|
||||
// *******************************************************************************************
|
||||
// //
|
||||
};
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
Copyright (c) 2024 - 2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
ROCPROFILER_SDK_USE_SYSTEM_ROCJPEG is set to 0 due to issues with the
|
||||
rocJPEG cmake setup and header files. Once they are resolved, the first
|
||||
if-condition should set the ROCPROFILER_SDK_USE_SYSTEM_ROCJPEG variable
|
||||
to 1
|
||||
*/
|
||||
#if !defined(ROCPROFILER_SDK_USE_SYSTEM_ROCJPEG)
|
||||
# if defined __has_include
|
||||
# if __has_include(<rocjpeg/rocjpeg.h>)
|
||||
# define ROCPROFILER_SDK_USE_SYSTEM_ROCJPEG 0
|
||||
# else
|
||||
# define ROCPROFILER_SDK_USE_SYSTEM_ROCJPEG 0
|
||||
# endif
|
||||
# else
|
||||
# define ROCPROFILER_SDK_USE_SYSTEM_ROCJPEG 0
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
Copyright (c) 2024 - 2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef ROCJPEG_VERSION_H
|
||||
#define ROCJPEG_VERSION_H
|
||||
|
||||
/*!
|
||||
* \file
|
||||
* \brief rocJPEG version
|
||||
* \defgroup group_rocjpeg_version rocJPEG Version
|
||||
* \brief rocJPEG version
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#define ROCJPEG_MAJOR_VERSION 0
|
||||
#define ROCJPEG_MINOR_VERSION 6
|
||||
#define ROCJPEG_MICRO_VERSION 0
|
||||
|
||||
/**
|
||||
* ROCJPEG_CHECK_VERSION:
|
||||
* @major: major version, like 1 in 1.2.3
|
||||
* @minor: minor version, like 2 in 1.2.3
|
||||
* @micro: micro version, like 3 in 1.2.3
|
||||
*
|
||||
* Evaluates to %TRUE if the version of rocJPEG is greater than
|
||||
* @major, @minor and @micro
|
||||
*/
|
||||
#define ROCJPEG_CHECK_VERSION(major, minor, micro) \
|
||||
(ROCJPEG_MAJOR_VERSION > (major) || \
|
||||
(ROCJPEG_MAJOR_VERSION == (major) && ROCJPEG_MINOR_VERSION > (minor)) || \
|
||||
(ROCJPEG_MAJOR_VERSION == (major) && ROCJPEG_MINOR_VERSION == (minor) && \
|
||||
ROCJPEG_MICRO_VERSION >= (micro)))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,31 @@
|
||||
// MIT License
|
||||
//
|
||||
// Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
|
||||
// NOLINTNEXTLINE(performance-enum-size)
|
||||
typedef enum
|
||||
{
|
||||
ROCPROFILER_ROCJPEG_TABLE_ID_NONE = -1,
|
||||
ROCPROFILER_ROCJPEG_TABLE_ID_CORE = 0,
|
||||
ROCPROFILER_ROCJPEG_TABLE_ID_LAST,
|
||||
} rocprofiler_rocjpeg_table_id_t;
|
||||
Reference in New Issue
Block a user