[PATCH 12/13] add POCL_EXPORT decorations
authorAndreas Beckmann <anbe@debian.org>
Fri, 5 Feb 2021 17:06:40 +0000 (18:06 +0100)
committerAndreas Beckmann <anbe@debian.org>
Tue, 16 Feb 2021 10:00:57 +0000 (10:00 +0000)
this is the minimal set needed for building the basic and pthread
devices with -fvisibility=hidden

Gbp-Pq: Name 0012-add-POCL_EXPORT-decorations.patch

12 files changed:
include/pocl.h
lib/CL/devices/common.h
lib/CL/devices/cpuinfo.h
lib/CL/devices/devices.h
lib/CL/devices/pocl_local_size.h
lib/CL/devices/prototypes.inc
lib/CL/devices/topology/pocl_topology.h
lib/CL/pocl_debug.h
lib/CL/pocl_llvm.h
lib/CL/pocl_llvm_api.h
lib/CL/pocl_runtime_config.h
lib/CL/pocl_util.h

index 8c4280ef9263cc072cd62112e336f4e236b51b51..128ee42030ac7213e2ddf7811efc3daf8af27351 100644 (file)
@@ -40,6 +40,8 @@
 
 #include "config.h"
 
+#include "pocl_export.h"
+
 #include "pocl_context.h"
 
 /* detects restrict, variadic macros etc */
index 239e69c4e9a6ae7a307dd8a4bbf7c85cc5714705..7b2bc0d3fac406d44a007c18aabb5de91bf74d64 100644 (file)
@@ -64,9 +64,11 @@ int llvm_codegen (char *output, unsigned device_i, cl_kernel kernel,
                   cl_device_id device, _cl_command_node *command,
                   int specialize);
 
+POCL_EXPORT
 void pocl_fill_dev_image_t (dev_image_t *di, struct pocl_argument *parg,
                             cl_device_id device);
 
+POCL_EXPORT
 void pocl_fill_dev_sampler_t (dev_sampler_t *ds, struct pocl_argument *parg);
 
 void pocl_copy_mem_object (cl_device_id dest_dev, cl_mem dest,
@@ -79,33 +81,42 @@ void pocl_migrate_mem_objects (_cl_command_node *node);
 void pocl_scheduler (_cl_command_node * volatile * ready_list,
                      pthread_mutex_t *lock_ptr);
 
+POCL_EXPORT
 void pocl_exec_command (_cl_command_node * volatile node);
 
+POCL_EXPORT
 void pocl_ndrange_node_cleanup(_cl_command_node *node);
 void pocl_mem_objs_cleanup (cl_event event);
 
+POCL_EXPORT
 void pocl_broadcast (cl_event event);
 
+POCL_EXPORT
 void pocl_init_dlhandle_cache ();
 
 char *pocl_check_kernel_disk_cache (_cl_command_node *cmd, int specialized);
 
 size_t pocl_cmd_max_grid_dim_width (_cl_command_run *cmd);
 
+POCL_EXPORT
 void pocl_check_kernel_dlhandle_cache (_cl_command_node *command,
                                        unsigned initial_refcount,
                                        int specialize);
 
+POCL_EXPORT
 void pocl_release_dlhandle_cache (_cl_command_node *cmd);
 
 void pocl_setup_device_for_system_memory(cl_device_id device);
 
 void pocl_reinit_system_memory();
 
+POCL_EXPORT
 void pocl_set_buffer_image_limits(cl_device_id device);
 
+POCL_EXPORT
 void* pocl_aligned_malloc_global_mem(cl_device_id device, size_t align, size_t size);
 
+POCL_EXPORT
 void pocl_free_global_mem(cl_device_id device, void *ptr, size_t size);
 
 void pocl_print_system_memory_stats();
@@ -113,6 +124,7 @@ void pocl_print_system_memory_stats();
 void pocl_calculate_kernel_hash (cl_program program, unsigned kernel_i,
                                  unsigned device_i);
 
+POCL_EXPORT
 void pocl_init_default_device_infos (cl_device_id dev);
 
 #ifdef __cplusplus
index 152793d8a5531cc7b76afc89f3c3a8619c94e0e2..a63d582796bae37ad2a5efa97166afa8ab4e6f78 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "pocl_cl.h"
 
+POCL_EXPORT
 void pocl_cpuinfo_detect_device_info(cl_device_id device);
 
 #endif /* POCL_TOPOLOGY_H */
index bbb0a663ef0dfa482110c0bc3a765aad0f99bcab..e15f3c40dd9a270cd7af65d148b4eddd9739b2e9 100644 (file)
@@ -68,6 +68,7 @@ unsigned int pocl_get_devices(cl_device_type device_type, struct _cl_device_id *
  * \return If the env var was not set, return -1, if the env var is specified, return 0
  * or the number of occurrence of dev_type in the env var
  */
+POCL_EXPORT
 int pocl_device_get_env_count(const char *dev_type);
 
 /**
index 0fb7316713288ca49414b11473163b055be8a2f5..359a195ce76cad6d94261102bb57f87136b0dc9b 100644 (file)
@@ -27,6 +27,7 @@
 #include "pocl_cl.h"
 /* The generic local size optimizer used by default, in case there's no target
  * specific one defined in the device driver. */
+POCL_EXPORT
 void pocl_default_local_size_optimizer (cl_device_id dev, size_t global_x,
                                         size_t global_y, size_t global_z,
                                         size_t *local_x, size_t *local_y,
index 91987eb7efba25a22af105bb4d324a17f099273e..80c584e5bd8772d0c633fc184b0f53f04f181530 100644 (file)
@@ -31,6 +31,7 @@
   void pocl_##__DRV__##_wait_event (cl_device_id device, cl_event event);     \
   void pocl_##__DRV__##_update_event (cl_device_id device, cl_event event);   \
   void pocl_##__DRV__##_free_event_data (cl_event event);                     \
+  POCL_EXPORT                                                                 \
   void pocl_##__DRV__##_init_device_ops (struct pocl_device_ops *ops);        \
   cl_int pocl_##__DRV__##_uninit (unsigned j, cl_device_id device);           \
   cl_int pocl_##__DRV__##_reinit (unsigned j, cl_device_id device);           \
index cc390f9f3db75a7da2a75c98bb2ba0a683d750c5..159ba308bf8be7037387945a2f0b801bd7317c5b 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "pocl_cl.h"
 
+POCL_EXPORT
 int pocl_topology_detect_device_info(cl_device_id device);
 
 #endif /* POCL_TOPOLOGY_H */
index 718cc3910c808d7fc19b60f9e413dae927cfb450..c0d1e635b9022f6237e27b6175dcca7970cb3de7 100644 (file)
@@ -17,6 +17,8 @@
 
 #include "config.h"
 
+#include "pocl_export.h"
+
 // size_t print spec
 #ifndef PRIuS
 # define PRIuS "zu"
@@ -105,7 +107,9 @@ extern "C" {
 
 #ifdef POCL_DEBUG_MESSAGES
 
+POCL_EXPORT
     extern uint64_t pocl_debug_messages_filter;
+POCL_EXPORT
     extern int pocl_stderr_is_a_tty;
 
     #define POCL_DEBUGGING_ON (pocl_debug_messages_filter)
@@ -118,9 +122,12 @@ extern "C" {
 
         #define POCL_DEBUG_HEADER(FILTER, FILTER_TYPE) \
             pocl_debug_print_header (__func__, __LINE__, #FILTER, FILTER_TYPE);
+POCL_EXPORT
         extern void pocl_debug_output_lock ();
+POCL_EXPORT
         extern void pocl_debug_output_unlock ();
         extern void pocl_debug_messages_setup (const char *debug);
+POCL_EXPORT
         extern void pocl_debug_print_header (const char * func, unsigned line,
                                              const char* filter, int filter_type);
         extern void pocl_debug_measure_start (uint64_t* start);
index bd1d47ff81adbb31345f4a766139a89465870687..960aca6d9c678802484b8b6c9c72ea78c39086ae 100644 (file)
@@ -30,6 +30,7 @@ extern "C" {
 #endif
 
 /* Returns the cpu name as reported by LLVM. */
+POCL_EXPORT
 char *get_llvm_cpu_name ();
 /* Returns if the cpu supports FMA instruction (uses LLVM). */
 int cpu_has_fma();
index d3bf44e9b8a66c0165eface391f691b257507b56..b33241a24aa85c76c7cc98cd54046c090c01bc0c 100644 (file)
@@ -65,6 +65,7 @@ public:
 };
 
 
+POCL_EXPORT
 extern cl_device_id currentPoclDevice;
 
 void InitializeLLVM();
index eb54dd942cbb2f8e75a78628fbb16c3694254933..7f47c13fb605fa0d8fa184bba39f8d4d857534f4 100644 (file)
 #ifndef _POCL_RUNTIME_CONFIG_H
 #define _POCL_RUNTIME_CONFIG_H
 
+#include "pocl_export.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 int pocl_is_option_set(const char *key);
+POCL_EXPORT
 int pocl_get_int_option(const char *key, int default_value);
+POCL_EXPORT
 int pocl_get_bool_option(const char *key, int default_value);
 const char* pocl_get_string_option(const char *key, const char *default_value);
 
index ce104602ad7edff1132e979c922f9c5f91a7b98f..c35c90865c419f119f0b012dd052aed87047936a 100644 (file)
@@ -57,17 +57,23 @@ uint32_t byteswap_uint32_t (uint32_t word, char should_swap);
 float byteswap_float (float word, char should_swap);
 
 /* set rounding mode */
+POCL_EXPORT
 void pocl_restore_rm (unsigned rm);
 /* get current rounding mode */
+POCL_EXPORT
 unsigned pocl_save_rm ();
 /* set OpenCL's default (round to nearest) rounding mode */
+POCL_EXPORT
 void pocl_set_default_rm ();
 
 /* sets the flush-denorms-to-zero flag on the CPU, if supported */
+POCL_EXPORT
 void pocl_set_ftz (unsigned ftz);
 
 /* saves / restores cpu flags*/
+POCL_EXPORT
 unsigned pocl_save_ftz ();
+POCL_EXPORT
 void pocl_restore_ftz (unsigned ftz);
 
 /* Finds the next highest power of two of the given value. */
@@ -83,6 +89,7 @@ uint64_t pocl_size_ceil2_64 (uint64_t x);
  * must be a non-zero power of 2.
  */
 
+POCL_EXPORT
 void *pocl_aligned_malloc(size_t alignment, size_t size);
 #define pocl_aligned_free(x) POCL_MEM_FREE(x)
 
@@ -131,6 +138,7 @@ check_copy_overlap(const size_t src_offset[3],
  * Push a command into ready list if all previous events are completed or
  * in pending_list if the command still has pending dependencies
  */
+POCL_EXPORT
 void
 pocl_command_push (_cl_command_node *node, 
                    _cl_command_node * volatile * ready_list, 
@@ -182,12 +190,15 @@ void pocl_abort_on_pthread_error (int status, unsigned line, const char *func);
 
 void pocl_update_event_queued (cl_event event);
 
+POCL_EXPORT
 void pocl_update_event_submitted (cl_event event);
 
 void pocl_update_event_running_unlocked (cl_event event);
 
+POCL_EXPORT
 void pocl_update_event_running (cl_event event);
 
+POCL_EXPORT
 void pocl_update_event_complete_msg (const char *func, unsigned line,
                                      cl_event event, const char *msg);
 
@@ -197,6 +208,7 @@ void pocl_update_event_complete_msg (const char *func, unsigned line,
 #define POCL_UPDATE_EVENT_COMPLETE(__event)                                   \
   pocl_update_event_complete_msg (__func__, __LINE__, (__event), NULL);
 
+POCL_EXPORT
 void pocl_update_event_failed (cl_event event);
 
 const char*