24.02.1
|
Go to the documentation of this file.
24 #ifndef ARM_COMPUTE_TEST_OPENCL_MEMORY_USAGE
25 #define ARM_COMPUTE_TEST_OPENCL_MEMORY_USAGE
50 std::string
id()
const override;
52 void start()
override;
61 std::function<decltype(
clSVMAlloc)> real_clSVMAlloc;
62 std::function<decltype(
clSVMFree)> real_clSVMFree;
65 float _scale_factor{};
68 Allocation() =
default;
69 Allocation(
size_t alloc_size)
76 std::map<cl_mem, Allocation> _allocations;
77 std::map<void *, size_t> _svm_allocations;
80 size_t total_allocated{ 0 };
81 size_t max_in_use{ 0 };
83 size_t num_allocations{ 0 };
std::string id() const override
Identifier for the instrument.
Instrument collecting memory usage information for OpenCL.
void test_start() override
Start of the test.
void clSVMFree(cl_context context, void *svm_pointer)
cl_mem clCreateBuffer(cl_context context, cl_mem_flags flags, size_t size, void *host_ptr, cl_int *errcode_ret)
void test_stop() override
End of the test.
cl_int clReleaseMemObject(cl_mem memobj)
void * clSVMAlloc(cl_context context, cl_svm_mem_flags_arm flags, size_t size, cl_uint alignment)
MeasurementsMap test_measurements() const override
Return the latest test measurements.
MeasurementsMap measurements() const override
Return the latest measurements.
void stop() override
Stop measuring.
Wrapper to configure the Khronos OpenCL C++ header.
OpenCLMemoryUsage(ScaleFactor scale_factor)
Construct an OpenCL timer.
Interface for classes that can be used to measure performance.
Copyright (c) 2017-2024 Arm Limited.
cl_int clRetainMemObject(cl_mem memobj)
void start() override
Start measuring.
std::map< std::string, Measurement > MeasurementsMap
Map of measurements.