silence some compiler warnings

This commit is contained in:
Axel Kohlmeyer
2021-08-31 15:10:50 -04:00
parent 6b243845c0
commit 08eb3345af
5 changed files with 15 additions and 17 deletions

View File

@ -23,7 +23,7 @@ namespace ucl_hip {
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
typedef hipStream_t command_queue; typedef hipStream_t command_queue;
inline void ucl_flush(command_queue &cq) {} inline void ucl_flush(command_queue &) {}
inline void ucl_sync(hipStream_t &stream) { inline void ucl_sync(hipStream_t &stream) {
CU_SAFE_CALL(hipStreamSynchronize(stream)); CU_SAFE_CALL(hipStreamSynchronize(stream));
@ -141,12 +141,12 @@ class UCL_Device {
/// Get a string telling the type of the current device /// Get a string telling the type of the current device
inline std::string device_type_name() { return device_type_name(_device); } inline std::string device_type_name() { return device_type_name(_device); }
/// Get a string telling the type of the device /// Get a string telling the type of the device
inline std::string device_type_name(const int i) { return "GPU"; } inline std::string device_type_name(const int) { return "GPU"; }
/// Get current device type (UCL_CPU, UCL_GPU, UCL_ACCELERATOR, UCL_DEFAULT) /// Get current device type (UCL_CPU, UCL_GPU, UCL_ACCELERATOR, UCL_DEFAULT)
inline enum UCL_DEVICE_TYPE device_type() { return device_type(_device); } inline enum UCL_DEVICE_TYPE device_type() { return device_type(_device); }
/// Get device type (UCL_CPU, UCL_GPU, UCL_ACCELERATOR, UCL_DEFAULT) /// Get device type (UCL_CPU, UCL_GPU, UCL_ACCELERATOR, UCL_DEFAULT)
inline enum UCL_DEVICE_TYPE device_type(const int i) { return UCL_GPU; } inline enum UCL_DEVICE_TYPE device_type(const int) { return UCL_GPU; }
/// Returns true if host memory is efficiently addressable from device /// Returns true if host memory is efficiently addressable from device
inline bool shared_memory() { return shared_memory(_device); } inline bool shared_memory() { return shared_memory(_device); }
@ -204,7 +204,7 @@ class UCL_Device {
// Get the bytes of free memory in the current device // Get the bytes of free memory in the current device
inline size_t free_bytes() { return free_bytes(_device); } inline size_t free_bytes() { return free_bytes(_device); }
// Get the bytes of free memory // Get the bytes of free memory
inline size_t free_bytes(const int i) { inline size_t free_bytes(const int) {
CUDA_INT_TYPE dfree, dtotal; CUDA_INT_TYPE dfree, dtotal;
CU_SAFE_CALL_NS(hipMemGetInfo(&dfree, &dtotal)); CU_SAFE_CALL_NS(hipMemGetInfo(&dfree, &dtotal));
return static_cast<size_t>(dfree); return static_cast<size_t>(dfree);
@ -257,26 +257,26 @@ class UCL_Device {
inline bool fission_equal() inline bool fission_equal()
{ return fission_equal(_device); } { return fission_equal(_device); }
/// True if splitting device into equal subdevices supported /// True if splitting device into equal subdevices supported
inline bool fission_equal(const int i) inline bool fission_equal(const int)
{ return false; } { return false; }
/// True if splitting device into subdevices by specified counts supported /// True if splitting device into subdevices by specified counts supported
inline bool fission_by_counts() inline bool fission_by_counts()
{ return fission_by_counts(_device); } { return fission_by_counts(_device); }
/// True if splitting device into subdevices by specified counts supported /// True if splitting device into subdevices by specified counts supported
inline bool fission_by_counts(const int i) inline bool fission_by_counts(const int)
{ return false; } { return false; }
/// True if splitting device into subdevices by affinity domains supported /// True if splitting device into subdevices by affinity domains supported
inline bool fission_by_affinity() inline bool fission_by_affinity()
{ return fission_by_affinity(_device); } { return fission_by_affinity(_device); }
/// True if splitting device into subdevices by affinity domains supported /// True if splitting device into subdevices by affinity domains supported
inline bool fission_by_affinity(const int i) inline bool fission_by_affinity(const int)
{ return false; } { return false; }
/// Maximum number of subdevices allowed from device fission /// Maximum number of subdevices allowed from device fission
inline int max_sub_devices() inline int max_sub_devices()
{ return max_sub_devices(_device); } { return max_sub_devices(_device); }
/// Maximum number of subdevices allowed from device fission /// Maximum number of subdevices allowed from device fission
inline int max_sub_devices(const int i) inline int max_sub_devices(const int)
{ return 0; } { return 0; }
/// True if the device supports shuffle intrinsics /// True if the device supports shuffle intrinsics
@ -290,8 +290,7 @@ class UCL_Device {
inline void print_all(std::ostream &out); inline void print_all(std::ostream &out);
/// For compatability with OCL API /// For compatability with OCL API
inline int auto_set_platform(const enum UCL_DEVICE_TYPE type=UCL_GPU, inline int auto_set_platform(const enum UCL_DEVICE_TYPE, const std::string)
const std::string vendor="")
{ return set_platform(0); } { return set_platform(0); }
inline int load_module(const void* program, hipModule_t& module, std::string *log=nullptr){ inline int load_module(const void* program, hipModule_t& module, std::string *log=nullptr){
@ -404,7 +403,7 @@ UCL_Device::~UCL_Device() {
clear(); clear();
} }
int UCL_Device::set_platform(const int pid) { int UCL_Device::set_platform(const int) {
clear(); clear();
#ifdef UCL_DEBUG #ifdef UCL_DEBUG
assert(pid<num_platforms()); assert(pid<num_platforms());

View File

@ -70,7 +70,7 @@ class UCL_Texture {
inline void unbind() { } inline void unbind() { }
/// Make a texture reference available to kernel /// Make a texture reference available to kernel
inline void allow(UCL_Kernel &kernel) { inline void allow(UCL_Kernel &) {
//#if CUDA_VERSION < 4000 //#if CUDA_VERSION < 4000
//CU_SAFE_CALL(cuParamSetTexRef(kernel._kernel, CU_PARAM_TR_DEFAULT, _tex)); //CU_SAFE_CALL(cuParamSetTexRef(kernel._kernel, CU_PARAM_TR_DEFAULT, _tex));
//#endif //#endif

View File

@ -39,7 +39,7 @@ class UCL_H_Vec : public UCL_BaseMat {
}; };
typedef numtyp data_type; typedef numtyp data_type;
UCL_H_Vec() : _cols(0), _row_bytes(0) { UCL_H_Vec() : _row_bytes(0), _cols(0){
#ifdef _OCL_MAT #ifdef _OCL_MAT
_carray=(cl_mem)(0); _carray=(cl_mem)(0);
#endif #endif

View File

@ -41,8 +41,7 @@ namespace LAMMPS_AL {
class Neighbor { class Neighbor {
public: public:
Neighbor() : _allocated(false), _use_packing(false), _ncells(0), Neighbor() : _allocated(false), _use_packing(false), _old_max_nbors(0), _ncells(0) {}
_old_max_nbors(0) {}
~Neighbor() { clear(); } ~Neighbor() { clear(); }
/// Determine whether neighbor unpacking should be used /// Determine whether neighbor unpacking should be used
@ -124,7 +123,7 @@ class Neighbor {
} }
} }
inline void acc_timers(FILE *screen) { inline void acc_timers(FILE *) {
if (_nbor_time_avail) { if (_nbor_time_avail) {
if (_time_device) { if (_time_device) {
time_nbor.add_to_total(); time_nbor.add_to_total();

View File

@ -66,7 +66,7 @@ class PPPM {
} }
/// Check if there is enough storage for local atoms and realloc if not /// Check if there is enough storage for local atoms and realloc if not
inline void resize_local(const int inum, bool &success) { inline void resize_local(const int, bool &) {
} }
/// Clear all host and device data /// Clear all host and device data