Apply formatting
This commit is contained in:
@@ -57,10 +57,10 @@ static void benchmark_cosf(benchmark::State &state) {
|
|||||||
reinterpret_cast<float *>(backend.allocate_memory(N * sizeof(float)));
|
reinterpret_cast<float *>(backend.allocate_memory(N * sizeof(float)));
|
||||||
float *c =
|
float *c =
|
||||||
reinterpret_cast<float *>(backend.allocate_memory(N * sizeof(float)));
|
reinterpret_cast<float *>(backend.allocate_memory(N * sizeof(float)));
|
||||||
|
|
||||||
if (!x || !c) {
|
if (!x || !c) {
|
||||||
throw std::runtime_error("Buffer allocation failed");
|
throw std::runtime_error("Buffer allocation failed");
|
||||||
}
|
}
|
||||||
auto end = std::chrono::high_resolution_clock::now();
|
auto end = std::chrono::high_resolution_clock::now();
|
||||||
state.counters["init_ms"] =
|
state.counters["init_ms"] =
|
||||||
std::chrono::duration_cast<std::chrono::microseconds>(end - start)
|
std::chrono::duration_cast<std::chrono::microseconds>(end - start)
|
||||||
@@ -96,7 +96,7 @@ static void benchmark_sincosf(benchmark::State &state) {
|
|||||||
float *c =
|
float *c =
|
||||||
reinterpret_cast<float *>(backend.allocate_memory(N * sizeof(float)));
|
reinterpret_cast<float *>(backend.allocate_memory(N * sizeof(float)));
|
||||||
if (!x || !s || !c) {
|
if (!x || !s || !c) {
|
||||||
throw std::runtime_error("Buffer allocation failed");
|
throw std::runtime_error("Buffer allocation failed");
|
||||||
}
|
}
|
||||||
auto end = std::chrono::high_resolution_clock::now();
|
auto end = std::chrono::high_resolution_clock::now();
|
||||||
state.counters["init_ms"] =
|
state.counters["init_ms"] =
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public:
|
|||||||
virtual void init(size_t n = 0) {}
|
virtual void init(size_t n = 0) {}
|
||||||
|
|
||||||
virtual void *allocate_memory(size_t bytes) const {
|
virtual void *allocate_memory(size_t bytes) const {
|
||||||
return static_cast<void*>(new uint8_t[bytes]);
|
return static_cast<void *>(new uint8_t[bytes]);
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void free_memory(void *ptr) const { delete[] ptr; };
|
virtual void free_memory(void *ptr) const { delete[] ptr; };
|
||||||
|
|||||||
Reference in New Issue
Block a user