diff options
Diffstat (limited to 'liboffloadmic/runtime/offload_common.h')
-rw-r--r-- | liboffloadmic/runtime/offload_common.h | 49 |
1 files changed, 44 insertions, 5 deletions
diff --git a/liboffloadmic/runtime/offload_common.h b/liboffloadmic/runtime/offload_common.h index 0fb66b5..445d47c 100644 --- a/liboffloadmic/runtime/offload_common.h +++ b/liboffloadmic/runtime/offload_common.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2014-2015 Intel Corporation. All Rights Reserved. + Copyright (c) 2014-2016 Intel Corporation. All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -58,6 +58,10 @@ #define getenv(x) __secure_getenv(x) #endif +// Offload Library versioning +DLL_LOCAL extern int offload_version; +DLL_LOCAL extern int offload_version_count; + // The debug routines // Host console and file logging @@ -181,15 +185,30 @@ enum OffloadItemType { c_cean_var, //!< CEAN variable c_cean_var_ptr, //!< Pointer to CEAN variable c_data_ptr_array, //!< Pointer to data pointer array + c_extended_type, //!< Is used to extend OffloadItemType + //!< Actual OffloadItemType is in the + //!< structure VarDescExtendedType c_func_ptr_array, //!< Pointer to function pointer array c_void_ptr_array, //!< Pointer to void* pointer array - c_string_ptr_array //!< Pointer to char* pointer array + c_string_ptr_array, //!< Pointer to char* pointer array + c_data_ptr_ptr, //!< Pointer to pointer to data (struct member) + c_func_ptr_ptr, //!< Pointer to pointer to function (struct member) + c_void_ptr_ptr, //!< Pointer to pointer to void* (struct member) + c_string_ptr_ptr, //!< Pointer to pointer to string (struct member) + c_cean_var_ptr_ptr //!< Pointer to pointer to cean var (struct member) }; +#define TYPE_IS_PTR_TO_PTR(t) ((t) == c_string_ptr_ptr || \ + (t) == c_data_ptr_ptr || \ + (t) == c_func_ptr_ptr || \ + (t) == c_void_ptr_ptr || \ + (t) == c_cean_var_ptr_ptr) + #define VAR_TYPE_IS_PTR(t) ((t) == c_string_ptr || \ (t) == c_data_ptr || \ (t) == c_cean_var_ptr || \ - (t) == c_dv_ptr) + (t) == c_dv_ptr || \ + TYPE_IS_PTR_TO_PTR(t)) #define VAR_TYPE_IS_SCALAR(t) ((t) == c_data || \ (t) == c_void_ptr || \ @@ -202,7 +221,6 @@ enum OffloadItemType { #define VAR_TYPE_IS_DV_DATA_SLICE(t) ((t) == c_dv_data_slice || \ (t) == c_dv_ptr_data_slice) - //! \enum Specify direction to copy offloaded variable. enum OffloadParameterType { c_parameter_unknown = -1, //!< Unknown clause @@ -228,7 +246,7 @@ union varDescFlags { uint32_t targetptr : 1; //! "preallocated" modifier used uint32_t preallocated : 1; - //! Needs documentation + //! pointer to a pointer array uint32_t is_pointer : 1; //! buffer address is sent in data @@ -244,8 +262,14 @@ union varDescFlags { uint32_t always_copy : 1; //! "OpenMP delete" modifier used uint32_t always_delete : 1; + //! structured data is noncontiguous + uint32_t is_non_cont_struct : 1; //! CPU memory pinning/unpinning operation uint32_t pin : 1; + //! Pointer to device memory + uint32_t is_device_ptr : 1; + //! Hostpointer with associated device pointer + uint32_t use_device_ptr : 1; }; uint32_t bits; }; @@ -384,6 +408,21 @@ const int flag_alloc_start_is_array = 18; const int flag_alloc_elements_is_scalar = 19; const int flag_alloc_elements_is_array = 20; +//! Extended Variable Descriptor. Since VarDesc uses 16 bits for +//! OffloadItemType, we have exceeded that limit, So any Type +//! greater than 15 will have Type set in VarDesc as c_extended_type +//! and this structure will be used to represent those Types. +typedef struct VarDescExtendedType { + + // Represents overflow of OffloadItemType + uint32_t extended_type; + + //! For extended_type + //! address of the variable + //! Future Types can point to other descriptors + void *ptr; +} VarDescExtendedType; + // The Marshaller class Marshaller { |