Skip to content

Commit

Permalink
let utestgpu init gpu
Browse files Browse the repository at this point in the history
  • Loading branch information
mblum94 committed Sep 18, 2022
1 parent d335fa4 commit 3f6ebb1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
13 changes: 13 additions & 0 deletions utests/test_cuda_convcorr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "num/flpmath.h"
#include "num/multind.h"
#include "num/convcorr.h"
#include "num/init.h"

#include "utest.h"

Expand All @@ -13,6 +14,8 @@ int cudnn = 0;

static bool test_convcorr_cf_1D(void)
{
num_init_gpu();

enum {N = 6};
long odims[N] = {2, 1, 3, 1, 1, 4};
long idims[N] = {1, 5, 5, 1, 1, 4};
Expand Down Expand Up @@ -48,6 +51,8 @@ UT_GPU_REGISTER_TEST(test_convcorr_cf_1D);

static bool test_convcorr_cf_2D(void)
{
num_init_gpu();

enum {N = 6};
long odims[N] = {2, 1, 3, 2, 1, 4};
long idims[N] = {1, 5, 5, 5, 1, 4};
Expand Down Expand Up @@ -83,6 +88,8 @@ UT_GPU_REGISTER_TEST(test_convcorr_cf_2D);

static bool test_convcorr_cf_3D(void)
{
num_init_gpu();

enum {N = 6};
long odims[N] = {2, 1, 3, 2, 1, 4};
long idims[N] = {1, 5, 5, 5, 4, 4};
Expand Down Expand Up @@ -118,6 +125,8 @@ UT_GPU_REGISTER_TEST(test_convcorr_cf_3D);

static bool test_convcorr_rand_ord(void)
{
num_init_gpu();

enum {N = 6};
long odims[N] = {2, 4, 3, 1, 2, 1};
long idims[N] = {1, 4, 5, 5, 5, 4};
Expand Down Expand Up @@ -154,6 +163,8 @@ UT_GPU_REGISTER_TEST(test_convcorr_rand_ord);

static bool test_convcorr_cf_one_channel(void)
{
num_init_gpu();

enum {N = 6};
long odims[N] = {2, 1, 3, 2, 1, 4};
long idims[N] = {1, 1, 5, 5, 4, 4};
Expand Down Expand Up @@ -191,6 +202,8 @@ UT_GPU_REGISTER_TEST(test_convcorr_cf_one_channel);

static bool test_convcorr_cf_dil_strs(void)
{
num_init_gpu();

enum {N = 6};
long odims[N] = {2, 1, 3, 3, 1, 4};
long idims[N] = {1, 5, 5, 7, 4, 4};
Expand Down
4 changes: 4 additions & 0 deletions utests/test_cuda_flpmath.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ typedef void (*md_z3opd_t)(unsigned int D, const long dims[D], const long ostrs[

static bool test_md_z3op(md_z3op_t function)
{
num_init_gpu();

enum { N = 3 };
const long dims[N] = { 2, 5, 3 };
long strs[N];
Expand Down Expand Up @@ -122,6 +124,8 @@ UT_GPU_REGISTER_TEST(test_md_zgreatequal2);

static bool test_md_z2op(md_z2op_t function)
{
num_init_gpu();

enum { N = 3 };
const long dims[N] = { 2, 5, 3 };
long strs[N];
Expand Down
6 changes: 6 additions & 0 deletions utests/test_cuda_gpukrnls.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

static bool test_im2col_loop_in(void)
{
num_init_gpu();

unsigned long size = CFL_SIZE;
unsigned int N = 5;

Expand Down Expand Up @@ -89,6 +91,8 @@ UT_GPU_REGISTER_TEST(test_im2col_loop_in);

static bool test_im2col_loop_out(void)
{
num_init_gpu();

unsigned long size = CFL_SIZE;
unsigned int N = 5;

Expand Down Expand Up @@ -154,6 +158,8 @@ UT_GPU_REGISTER_TEST(test_im2col_loop_out);

static bool test_im2col_adj(void)
{
num_init_gpu();

unsigned long size = CFL_SIZE;
unsigned int N = 5;

Expand Down

0 comments on commit 3f6ebb1

Please sign in to comment.