#include "config.h"
+#include "pocl_export.h"
+
#include "pocl_context.h"
/* detects restrict, variadic macros etc */
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,
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();
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
#include "pocl_cl.h"
+POCL_EXPORT
void pocl_cpuinfo_detect_device_info(cl_device_id device);
#endif /* POCL_TOPOLOGY_H */
* \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);
/**
#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,
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); \
#include "pocl_cl.h"
+POCL_EXPORT
int pocl_topology_detect_device_info(cl_device_id device);
#endif /* POCL_TOPOLOGY_H */
#include "config.h"
+#include "pocl_export.h"
+
// size_t print spec
#ifndef PRIuS
# define PRIuS "zu"
#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)
#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);
#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();
};
+POCL_EXPORT
extern cl_device_id currentPoclDevice;
void InitializeLLVM();
#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);
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. */
* 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)
* 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,
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);
#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*