Skip to content

Commit

Permalink
Fix the remaining warnings in hip backend
Browse files Browse the repository at this point in the history
  • Loading branch information
thilinarmtb committed Oct 4, 2023
1 parent 3d1f927 commit da01ca3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backends/unified-cuda-hip-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static backendrtcResult backend_compile(backendrtcProgram prog,
return backendrtcCompileProgram(prog, 1, opts);
}

static int backend_update(nomp_backend_t *bnd, nomp_mem_t *m,
static int backend_update(nomp_backend_t *NOMP_UNUSED(bnd), nomp_mem_t *m,
const nomp_map_direction_t op, size_t start,
size_t end, size_t usize) {
if (op & NOMP_ALLOC)
Expand Down Expand Up @@ -142,7 +142,7 @@ static int backend_knl_build(nomp_backend_t *bnd, nomp_prog_t *prg,
return 0;
}

static int backend_knl_run(nomp_backend_t *bnd, nomp_prog_t *prg) {
static int backend_knl_run(nomp_backend_t *NOMP_UNUSED(bnd), nomp_prog_t *prg) {
nomp_arg_t *args = prg->args;
void *vargs[NOMP_MAX_KERNEL_ARGS_SIZE];
for (unsigned i = 0; i < prg->nargs; i++) {
Expand All @@ -168,7 +168,7 @@ static int backend_knl_free(nomp_prog_t *prg) {
return 0;
}

static int backend_sync(nomp_backend_t *bnd) {
static int backend_sync(nomp_backend_t *NOMP_UNUSED(bnd)) {
check_driver(backendDeviceSynchronize());
return 0;
}
Expand Down Expand Up @@ -219,7 +219,7 @@ static int backend_device_query(nomp_backend_t *bnd, int device) {
}

#define backend_init TOKEN_PASTE(DRIVER, _init)
int backend_init(nomp_backend_t *const backend, const int platform,
int backend_init(nomp_backend_t *const backend, const int NOMP_UNUSED(platform),
const int device) {
int num_devices;
check_driver(backendGetDeviceCount(&num_devices));
Expand Down
6 changes: 6 additions & 0 deletions include/nomp-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,12 @@ typedef struct nomp_backend nomp_backend_t;
extern "C" {
#endif

#ifdef __GNUC__
#define NOMP_UNUSED(x) NOMP_UNUSED_##x __attribute__((__unused__))
#else
#define NOMP_UNUSED(x) NOMP_UNUSED_##x
#endif

/**
* @defgroup nomp_internal_macros Internal macros
* @brief Internal macros used in libnomp.
Expand Down
1 change: 1 addition & 0 deletions src/loopy.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ void nomp_py_print(const char *const message, PyObject *const obj) {
*/
int nomp_py_init(const nomp_config_t *const cfg) {
strncpy(backend, cfg->backend, NOMP_MAX_BUFFER_SIZE);
backend[NOMP_MAX_BUFFER_SIZE] = '\0';

if (!Py_IsInitialized()) {
// May be we need the isolated configuration listed here:
Expand Down

0 comments on commit da01ca3

Please sign in to comment.