CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
114 lines
2.7 KiB
C++
114 lines
2.7 KiB
C++
/*
|
|
* Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#include "cl_common.hpp"
|
|
#include <CL/cl_ext.h>
|
|
|
|
#include "platform/object.hpp"
|
|
#include "platform/context.hpp"
|
|
#include "platform/command.hpp"
|
|
#include "platform/counter.hpp"
|
|
|
|
#ifdef cl_amd_atomic_counters
|
|
|
|
/*! \addtogroup API
|
|
* @{
|
|
* \addtogroup CL_Counters
|
|
*
|
|
* Counter objects ...
|
|
*
|
|
* @{
|
|
*/
|
|
|
|
/*! \brief
|
|
*
|
|
* \version 1.1r18
|
|
*/
|
|
RUNTIME_ENTRY_RET(cl_counter_amd, clCreateCounterAMD,
|
|
(cl_context context, cl_counter_flags_amd flags, cl_uint value,
|
|
cl_int* errcode_ret)) {
|
|
*not_null(errcode_ret) = CL_INVALID_CONTEXT;
|
|
return (cl_counter_amd)0;
|
|
}
|
|
RUNTIME_EXIT
|
|
|
|
/*! \brief
|
|
*
|
|
* \version 1.1r18
|
|
*/
|
|
RUNTIME_ENTRY(cl_int, clGetCounterInfoAMD,
|
|
(cl_counter_amd counter, cl_counter_info_amd param_name, size_t param_value_size,
|
|
void* param_value, size_t* param_value_size_ret)) {
|
|
return CL_INVALID_COUNTER_AMD;
|
|
}
|
|
RUNTIME_EXIT
|
|
|
|
/*! \brief Increment the counter reference count.
|
|
*
|
|
* \return CL_SUCCESS if the function is executed successfully. It returns
|
|
* CL_INVALID_COUNTER if \a counter is not a valid counter object.
|
|
*
|
|
* The OpenCL commands that return a counter perform an implicit retain.
|
|
*
|
|
* \version 1.1r18
|
|
*/
|
|
RUNTIME_ENTRY(cl_int, clRetainCounterAMD, (cl_counter_amd counter)) {
|
|
if (!is_valid(counter)) {
|
|
return CL_INVALID_COUNTER_AMD;
|
|
}
|
|
as_amd(counter)->retain();
|
|
return CL_SUCCESS;
|
|
}
|
|
RUNTIME_EXIT
|
|
|
|
/*! \brief Decrement the counter reference count.
|
|
*
|
|
* \return CL_SUCCESS if the function is executed successfully. It returns
|
|
* CL_INVALID_EVENT if \a counter is not a valid counter object.
|
|
*
|
|
* The counter object is deleted once the reference count becomes zero.
|
|
*
|
|
* \version 1.1r18
|
|
*/
|
|
RUNTIME_ENTRY(cl_int, clReleaseCounterAMD, (cl_counter_amd counter)) {
|
|
if (!is_valid(counter)) {
|
|
return CL_INVALID_COUNTER_AMD;
|
|
}
|
|
as_amd(counter)->release();
|
|
return CL_SUCCESS;
|
|
}
|
|
RUNTIME_EXIT
|
|
|
|
/*! \brief
|
|
*
|
|
* \version 1.1r18
|
|
*/
|
|
RUNTIME_ENTRY(cl_int, clEnqueueReadCounterAMD,
|
|
(cl_command_queue command_queue, cl_counter_amd counter, cl_bool blocking_read,
|
|
cl_uint* value, cl_uint num_events_in_wait_list, const cl_event* event_wait_list,
|
|
cl_event* event)) {
|
|
return CL_INVALID_COUNTER_AMD;
|
|
}
|
|
RUNTIME_EXIT
|
|
|
|
/*! \brief
|
|
*
|
|
* \version 1.1r18
|
|
*/
|
|
RUNTIME_ENTRY(cl_int, clEnqueueWriteCounterAMD,
|
|
(cl_command_queue command_queue, cl_counter_amd counter, cl_bool blocking_write,
|
|
cl_uint value, cl_uint num_events_in_wait_list, const cl_event* event_wait_list,
|
|
cl_event* event)) {
|
|
return CL_INVALID_COUNTER_AMD;
|
|
}
|
|
RUNTIME_EXIT
|
|
|
|
/*! @}
|
|
* @}
|
|
*/
|
|
|
|
#endif // cl_amd_atomic_counters
|