Skip to content

Commit a7aed93

Browse files
committed
misc: fix build warnings
Things fixed: * accel: couple of header changes * cuda: unused function and sign compares * llvm-wg: braces in assert * test: removal of target ocl version
1 parent ab1a76a commit a7aed93

File tree

6 files changed

+8
-6
lines changed

6 files changed

+8
-6
lines changed

examples/accel/OpenCLcontext.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
IN THE SOFTWARE.
2222
*/
2323

24-
25-
#include <CL/cl2.hpp>
24+
#include <CL/opencl.hpp>
2625

2726
#include <string>
2827
#include <vector>

examples/accel/OpenCLcontext.h

+2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424

2525
#pragma once
2626

27+
#ifndef CL_USE_DEPRECATED_OPENCL_1_1_APIS
2728
#define CL_USE_DEPRECATED_OPENCL_1_1_APIS
29+
#endif
2830
#undef CL_HPP_ENABLE_EXCEPTIONS
2931

3032
#include <memory>

lib/CL/devices/cuda/pocl-cuda.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2090,6 +2090,7 @@ pocl_cuda_submit_kernel (CUstream stream, _cl_command_node *cmd,
20902090
}
20912091
case POCL_ARG_TYPE_IMAGE:
20922092
case POCL_ARG_TYPE_SAMPLER:
2093+
case POCL_ARG_TYPE_PIPE:
20932094
POCL_ABORT ("Unhandled argument type for CUDA\n");
20942095
break;
20952096
}
@@ -2375,8 +2376,7 @@ pocl_cuda_submit_node (_cl_command_node *node, cl_command_queue cq, int locked)
23752376
}
23762377
else
23772378
{
2378-
int i;
2379-
for (i = 0; i < cmd->svm_free.num_svm_pointers; i++)
2379+
for (unsigned int i = 0; i < cmd->svm_free.num_svm_pointers; i++)
23802380
{
23812381
void *ptr = cmd->svm_free.svm_pointers[i];
23822382
POCL_LOCK_OBJ (event->context);

lib/CL/devices/cuda/pocl-ptx-gen.cc

+2
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ void fixPrintF(llvm::Module *Module) {
470470

471471
// TODO broken, replaces in whole module not just 1 function
472472
// Replace all load users of a scalar global variable with new value.
473+
#if 0
473474
static void replaceScalarGlobalVar(llvm::Module *Module, const char *Name,
474475
llvm::Value *NewValue) {
475476
auto GlobalVar = Module->getGlobalVariable(Name);
@@ -486,6 +487,7 @@ static void replaceScalarGlobalVar(llvm::Module *Module, const char *Name,
486487
}
487488
GlobalVar->eraseFromParent();
488489
}
490+
#endif
489491

490492
// Add an extra kernel argument for the dimensionality.
491493
void handleGetWorkDim(llvm::Module *Module) {

lib/CL/pocl_llvm_wg.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ static int convertBCorSPV(char *InputPath,
838838
uint64_t ContentSize = 0;
839839
llvm::LLVMContext LLVMCtx;
840840

841-
assert(Reverse || TargetVersion.major && "Invalid SPIR-V target version!");
841+
assert((Reverse || TargetVersion.major) && "Invalid SPIR-V target version!");
842842

843843
#ifdef HAVE_LLVM_SPIRV_LIB
844844
std::string Errors;

tests/regression/test_issue_1525.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
#define CL_HPP_ENABLE_EXCEPTIONS
88
#define CL_HPP_MINIMUM_OPENCL_VERSION 110
9-
#define CL_HPP_TARGET_OPENCL_VERSION 110
109
#include <CL/opencl.hpp>
1110
#include <cassert>
1211
#include <iostream>

0 commit comments

Comments
 (0)