rocprofiler-sdk/rocjpeg/api_args.h Source File

rocprofiler-sdk/rocjpeg/api_args.h Source File#

ROCprofiler-SDK developer API: rocprofiler-sdk/rocjpeg/api_args.h Source File
ROCprofiler-SDK developer API 1.0.0
ROCm Profiling API and tools
api_args.h
1// MIT License
2//
3// Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved.
4//
5// Permission is hereby granted, free of charge, to any person obtaining a copy
6// of this software and associated documentation files (the "Software"), to deal
7// in the Software without restriction, including without limitation the rights
8// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9// copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21// THE SOFTWARE.
22
23#pragma once
24
25#include <rocprofiler-sdk/defines.h>
26
27#include <rocprofiler-sdk/rocjpeg/details/rocjpeg_headers.h>
28
29#if ROCPROFILER_SDK_USE_SYSTEM_ROCJPEG > 0
30# include <rocjpeg/rocjpeg.h>
31#else
32# include <rocprofiler-sdk/rocjpeg/details/rocjpeg.h>
33#endif
34
35#include <stdint.h>
36
37ROCPROFILER_EXTERN_C_INIT
38
39// Empty struct has a size of 0 in C but size of 1 in C++.
40// This struct is added to the union members which represent
41// functions with no arguments to ensure ABI compatibility
42typedef struct rocprofiler_rocjpeg_api_no_args
43{
44 char empty;
45} rocprofiler_rocjpeg_api_no_args;
46
47typedef union rocprofiler_rocjpeg_api_retval_t
48{
49 int32_t rocJpegStatus_retval;
50 const char* const_charp_retval;
51} rocprofiler_rocjpeg_api_retval_t;
52
53typedef union rocprofiler_rocjpeg_api_args_t
54{
55 struct
56 {
57 RocJpegStreamHandle* jpeg_stream_handle;
58 } rocJpegStreamCreate;
59
60 struct
61 {
62 const unsigned char* data;
63 size_t length;
64 RocJpegStreamHandle jpeg_stream_handle;
65 } rocJpegStreamParse;
66
67 struct
68 {
69 RocJpegStreamHandle jpeg_stream_handle;
70 } rocJpegStreamDestroy;
71
72 struct
73 {
74 RocJpegBackend backend;
75 int device_id;
76 RocJpegHandle* handle;
77 } rocJpegCreate;
78
79 struct
80 {
81 RocJpegHandle handle;
82 } rocJpegDestroy;
83
84 struct
85 {
86 RocJpegHandle handle;
87 RocJpegStreamHandle jpeg_stream_handle;
88 uint8_t* num_components;
89 RocJpegChromaSubsampling* subsampling;
90 uint32_t* widths;
91 uint32_t* heights;
92 } rocJpegGetImageInfo;
93
94 struct
95 {
96 RocJpegHandle handle;
97 RocJpegStreamHandle jpeg_stream_handle;
98 const RocJpegDecodeParams* decode_params;
99 RocJpegImage* destination;
100 } rocJpegDecode;
101
102 struct
103 {
104 RocJpegHandle handle;
105 RocJpegStreamHandle* jpeg_stream_handles;
106 int batch_size;
107 const RocJpegDecodeParams* decode_params;
108 RocJpegImage* destinations;
109 } rocJpegDecodeBatched;
110
111 struct
112 {
113 RocJpegStatus rocjpeg_status;
114 } rocJpegGetErrorName;
115} rocprofiler_rocjpeg_api_args_t;
116
117ROCPROFILER_EXTERN_C_FINI