Skip to content

Commit 204347d

Browse files
committed
Release v0.2.1
1 parent 58102b5 commit 204347d

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

FastChwHwcConverterCuda.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ static inline bool initCudaFunctions(std::string& compiledPtxStr)
379379
return true;
380380
}
381381

382-
static inline bool initAll()
382+
static inline bool initAllCUDA()
383383
{
384384
std::lock_guard<std::mutex> lock(CUDAMutex);
385385
if (initCUDAStatus == InitCUDAStatusEnum::Ready) {
@@ -437,7 +437,7 @@ inline void hwc2chw_cuda(
437437
const size_t h, const size_t w, const size_t c,
438438
const uint8_t* src, float* dst,
439439
const float alpha = 1.f/255.f) {
440-
if (!initAll()) {
440+
if (!initAllCUDA()) {
441441
// use cpu
442442
hwc2chw<uint8_t, float>(h, w, c, src, dst, alpha); return;
443443
}
@@ -519,7 +519,7 @@ inline void chw2hwc_cuda(
519519
const size_t c, const size_t h, const size_t w,
520520
const float* src, uint8_t* dst,
521521
const uint8_t alpha = 255.0f) {
522-
if (!initAll()) {
522+
if (!initAllCUDA()) {
523523
// use cpu
524524
chw2hwc<float, uint8_t>(c, h, w, src, dst, alpha); return;
525525
}

FastChwHwcConverterROCm.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ inline void hwc2chw_rocm(
496496
const size_t h, const size_t w, const size_t c,
497497
const uint8_t* src, float* dst,
498498
const float alpha = 1.f/255.f) {
499-
if (!initAll()) {
499+
if (!initAllROCm()) {
500500
// use cpu
501501
hwc2chw<uint8_t, float>(h, w, c, src, dst, alpha); return;
502502
}
@@ -581,7 +581,7 @@ inline void chw2hwc_rocm(
581581
const size_t c, const size_t h, const size_t w,
582582
const float* src, uint8_t* dst,
583583
const uint8_t alpha = 255.0f) {
584-
if (!initAll()) {
584+
if (!initAllROCm()) {
585585
// use cpu
586586
chw2hwc<float, uint8_t>(c, h, w, src, dst, alpha); return;
587587
}

test/cuda_benchmark.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#define TEST_COUNT 100
88

99
int main() {
10-
bool init = whyb::initAll();
10+
bool init = whyb::initAllCUDA();
1111
if (!init) {
1212
std::cout << "CUDA init error!" << std::endl;
1313
return 0;

test/rocm_benchmark.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
#include <chrono>
55

66
#include "FastChwHwcConverterROCm.hpp"
7-
#define TEST_COUNT 10
7+
#define TEST_COUNT 100
88

99
int main() {
10-
bool init = whyb::initAll();
10+
bool init = whyb::initAllROCm();
1111
if (!init) {
1212
std::cout << "ROCm init error!" << std::endl;
1313
return 0;

0 commit comments

Comments
 (0)