From 5eb921253525b80c2441f5a2811eae9203e3d391 Mon Sep 17 00:00:00 2001 From: Philippe Tillet Date: Tue, 21 Jul 2015 22:02:36 -0700 Subject: [PATCH] Code quality: more ISAACEXPORT --- include/isaac/defines.h | 4 ++-- include/isaac/driver/backend.h | 3 ++- include/isaac/driver/buffer.h | 4 ++-- include/isaac/driver/command_queue.h | 9 +++++---- include/isaac/driver/common.h | 15 ++++++++------- include/isaac/driver/context.h | 4 ++-- include/isaac/driver/device.h | 5 +++-- include/isaac/driver/event.h | 4 +++- include/isaac/driver/handle.h | 3 ++- include/isaac/driver/kernel.h | 3 ++- include/isaac/driver/ndrange.h | 3 ++- include/isaac/driver/platform.h | 3 ++- include/isaac/driver/program.h | 3 ++- 13 files changed, 37 insertions(+), 26 deletions(-) diff --git a/include/isaac/defines.h b/include/isaac/defines.h index 8286d2f75..c8ebbf4fc 100644 --- a/include/isaac/defines.h +++ b/include/isaac/defines.h @@ -3,9 +3,9 @@ #if defined(_WIN32) || defined(_MSC_VER) #ifdef ISAAC_DLL - #define ISCAPI __declspec(dllexport) + #define ISAACAPI __declspec(dllexport) #else - #define ISCAPI __declspec(dllimport) + #define ISAACAPI __declspec(dllimport) #endif #else #define ISAACAPI __attribute__((visibility("default"))) diff --git a/include/isaac/driver/backend.h b/include/isaac/driver/backend.h index dd557febd..72771943b 100644 --- a/include/isaac/driver/backend.h +++ b/include/isaac/driver/backend.h @@ -4,6 +4,7 @@ #include #include +#include "isaac/defines.h" #include "isaac/driver/command_queue.h" #include "isaac/driver/context.h" @@ -12,7 +13,7 @@ namespace isaac namespace driver { -class queues_type +class ISAACAPI queues_type { public: typedef std::list > > container_type; diff --git a/include/isaac/driver/buffer.h b/include/isaac/driver/buffer.h index d2b66f27d..4f83a51f4 100644 --- a/include/isaac/driver/buffer.h +++ b/include/isaac/driver/buffer.h @@ -2,7 +2,7 @@ #define ISAAC_DRIVER_BUFFER_H #include "isaac/types.h" - +#include "isaac/defines.h" #include "isaac/driver/common.h" #include "isaac/driver/context.h" #include "isaac/driver/handle.h" @@ -14,7 +14,7 @@ namespace driver { // Buffer -class Buffer +class ISAACAPI Buffer { friend class CommandQueue; friend class Kernel; diff --git a/include/isaac/driver/command_queue.h b/include/isaac/driver/command_queue.h index e6828d2e0..f4cf58822 100644 --- a/include/isaac/driver/command_queue.h +++ b/include/isaac/driver/command_queue.h @@ -2,9 +2,10 @@ #define ISAAC_DRIVER_COMMAND_QUEUE_H #include -#include "common.h" -#include "context.h" -#include "device.h" +#include "isaac/defines.h" +#include "isaac/driver/common.h" +#include "isaac/driver/context.h" +#include "isaac/driver/device.h" #include "isaac/driver/handle.h" namespace isaac @@ -19,7 +20,7 @@ class NDRange; class Buffer; // Command Queue -class CommandQueue +class ISAACAPI CommandQueue { public: CommandQueue(cl::CommandQueue const & queue); diff --git a/include/isaac/driver/common.h b/include/isaac/driver/common.h index 5fb24a5db..242f710eb 100644 --- a/include/isaac/driver/common.h +++ b/include/isaac/driver/common.h @@ -6,13 +6,14 @@ #include #include #endif +#include "isaac/defines.h" namespace isaac { namespace driver { -enum backend_type +enum ISAACAPI backend_type { OPENCL #ifdef ISAAC_WITH_CUDA @@ -20,7 +21,7 @@ enum backend_type #endif }; -enum device_type +enum ISAACAPI device_type { DEVICE_TYPE_GPU = CL_DEVICE_TYPE_GPU, DEVICE_TYPE_CPU = CL_DEVICE_TYPE_CPU, @@ -35,7 +36,7 @@ namespace nvrtc namespace exception { -#define ISAAC_CREATE_NVRTC_EXCEPTION(name, msg) class name: public std::exception { public: const char * what() const throw(){ return "NVRTC: Error- " msg; } } +#define ISAAC_CREATE_NVRTC_EXCEPTION(name, msg) class ISAACAPI name: public std::exception { public: const char * what() const throw(){ return "NVRTC: Error- " msg; } } ISAAC_CREATE_NVRTC_EXCEPTION(out_of_memory ,"out of memory exception"); ISAAC_CREATE_NVRTC_EXCEPTION(program_creation_failure ,"program creation failure"); @@ -60,7 +61,7 @@ namespace cuda class base: public std::exception{}; -#define ISAAC_CREATE_CUDA_EXCEPTION(name, msg) class name: public base { public:const char * what() const throw(){ return "CUDA: Error- " msg; } } +#define ISAAC_CREATE_CUDA_EXCEPTION(name, msg) class ISAACAPI name: public base { public:const char * what() const throw(){ return "CUDA: Error- " msg; } } ISAAC_CREATE_CUDA_EXCEPTION(invalid_value ,"invalid value"); @@ -135,9 +136,9 @@ namespace ocl namespace exception { - class base: public std::exception{}; + class ISAACAPI base: public std::exception{}; -#define ISAAC_CREATE_CL_EXCEPTION(name, msg) class name: public base { public: const char * what() const throw(){ return "OpenCL: Error- " msg; } } +#define ISAAC_CREATE_CL_EXCEPTION(name, msg) class ISAACAPI name: public base { public: const char * what() const throw(){ return "OpenCL: Error- " msg; } } ISAAC_CREATE_CL_EXCEPTION(device_not_found, "device not found"); @@ -191,7 +192,7 @@ namespace ocl #endif } -void check(cl_int err); +ISAACAPI void check(cl_int err); } diff --git a/include/isaac/driver/context.h b/include/isaac/driver/context.h index ce81edfb8..a2729664f 100644 --- a/include/isaac/driver/context.h +++ b/include/isaac/driver/context.h @@ -3,7 +3,7 @@ #include #include - +#include "isaac/defines.h" #include "isaac/driver/common.h" #include "isaac/driver/device.h" #include "isaac/driver/handle.h" @@ -14,7 +14,7 @@ namespace isaac namespace driver { -class Context +class ISAACAPI Context { friend class Program; friend class CommandQueue; diff --git a/include/isaac/driver/device.h b/include/isaac/driver/device.h index e72879a6a..d18f5e9fd 100644 --- a/include/isaac/driver/device.h +++ b/include/isaac/driver/device.h @@ -1,6 +1,7 @@ #ifndef ISAAC_DRIVER_DEVICE_H #define ISAAC_DRIVER_DEVICE_H +#include "isaac/defines.h" #include "isaac/driver/common.h" #include "isaac/driver/platform.h" #include "isaac/driver/handle.h" @@ -12,14 +13,14 @@ namespace driver { // Device -class Device +class ISAACAPI Device { private: friend class Context; friend class CommandQueue; public: - enum VENDOR + enum ISAACAPI VENDOR { AMD, INTEL, diff --git a/include/isaac/driver/event.h b/include/isaac/driver/event.h index a6546bef5..16fb00d2b 100644 --- a/include/isaac/driver/event.h +++ b/include/isaac/driver/event.h @@ -1,8 +1,10 @@ #ifndef ISAAC_DRIVER_EVENT_H #define ISAAC_DRIVER_EVENT_H +#include "isaac/defines.h" #include "isaac/driver/common.h" #include "isaac/driver/handle.h" + namespace isaac { @@ -10,7 +12,7 @@ namespace driver { // Event -class Event +class ISAACAPI Event { friend class CommandQueue; public: diff --git a/include/isaac/driver/handle.h b/include/isaac/driver/handle.h index a4948d481..790152b32 100644 --- a/include/isaac/driver/handle.h +++ b/include/isaac/driver/handle.h @@ -4,6 +4,7 @@ #include #include +#include "isaac/defines.h" #include "isaac/driver/common.h" #include namespace isaac @@ -19,7 +20,7 @@ namespace driver #endif template -class Handle +class ISAACAPI Handle { private: #ifdef ISAAC_WITH_CUDA diff --git a/include/isaac/driver/kernel.h b/include/isaac/driver/kernel.h index 34edd7802..07ec59c23 100644 --- a/include/isaac/driver/kernel.h +++ b/include/isaac/driver/kernel.h @@ -1,6 +1,7 @@ #ifndef ISAAC_DRIVER_KERNEL_H #define ISAAC_DRIVER_KERNEL_H +#include "isaac/defines.h" #include "isaac/driver/common.h" #include "isaac/driver/program.h" #include "isaac/driver/handle.h" @@ -16,7 +17,7 @@ namespace driver class Buffer; // Kernel -class Kernel +class ISAACAPI Kernel { friend class CommandQueue; public: diff --git a/include/isaac/driver/ndrange.h b/include/isaac/driver/ndrange.h index a40676de7..49bf0de96 100644 --- a/include/isaac/driver/ndrange.h +++ b/include/isaac/driver/ndrange.h @@ -1,6 +1,7 @@ #ifndef ISAAC_DRIVER_NDRANGE_H #define ISAAC_DRIVER_NDRANGE_H +#include "isaac/defines.h" #include "isaac/driver/common.h" namespace isaac @@ -10,7 +11,7 @@ namespace driver { // NDRange -class NDRange +class ISAACAPI NDRange { public: NDRange(size_t size0 = 1, size_t size1 = 1, size_t size2 = 1); diff --git a/include/isaac/driver/platform.h b/include/isaac/driver/platform.h index 42ad312c9..5f21552b6 100644 --- a/include/isaac/driver/platform.h +++ b/include/isaac/driver/platform.h @@ -1,6 +1,7 @@ #ifndef ISAAC_DRIVER_PLATFORM_H #define ISAAC_DRIVER_PLATFORM_H +#include "isaac/defines.h" #include "isaac/driver/common.h" namespace isaac @@ -11,7 +12,7 @@ namespace driver class Device; -class Platform +class ISAACAPI Platform { private: public: diff --git a/include/isaac/driver/program.h b/include/isaac/driver/program.h index d75fd41e2..bc6fe235b 100644 --- a/include/isaac/driver/program.h +++ b/include/isaac/driver/program.h @@ -1,6 +1,7 @@ #ifndef ISAAC_DRIVER_PROGRAM_H #define ISAAC_DRIVER_PROGRAM_H +#include "isaac/defines.h" #include "isaac/driver/common.h" #include "isaac/driver/context.h" #include "isaac/driver/handle.h" @@ -13,7 +14,7 @@ namespace driver class Context; -class Program +class ISAACAPI Program { friend class Kernel; public: