DPC++ Runtime
Runtime libraries for oneAPI DPC++
pi_hip.cpp File Reference
#include <CL/sycl/detail/defines.hpp>
#include <CL/sycl/detail/hip_definitions.hpp>
#include <CL/sycl/detail/pi.hpp>
#include <pi_hip.hpp>
#include <algorithm>
#include <cassert>
#include <hip/hip_runtime.h>
#include <limits>
#include <memory>
#include <mutex>
#include <regex>
#include <string.h>
Include dependency graph for pi_hip.cpp:

Go to the source code of this file.

Classes

class  ReleaseGuard< T >
 RAII object that calls the reference count release function on the held PI object on destruction. More...
 

Namespaces

 cl
 We provide new interfaces for matrix muliply in this patch:
 
 cl::sycl
 
 cl::sycl::detail
 
 cl::sycl::detail::pi
 

Macros

#define _PI_CL(pi_api, hip_api)   (PluginInit->PiFunctionTable).pi_api = (decltype(&::pi_api))(&hip_api);
 

Functions

void cl::sycl::detail::pi::die (const char *Message)
 
void cl::sycl::detail::pi::hipPrint (const char *Message)
 
void cl::sycl::detail::pi::assertion (bool Condition, const char *Message=nullptr)
 
pi_result hip_piEnqueueEventsWait (pi_queue command_queue, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event)
 Enqueues a wait on the given queue for all events. More...
 
pi_result hip_piEnqueueEventsWaitWithBarrier (pi_queue command_queue, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event)
 Enqueues a wait on the given queue for all specified events. More...
 
pi_result hip_piEventRelease (pi_event event)
 
pi_result hip_piEventRetain (pi_event event)
 
pi_result enqueueEventWait (pi_queue queue, pi_event event)
 
std::string getKernelNames (pi_program program)
 Finds kernel names by searching for entry points in the PTX source, as the HIP driver API doesn't expose an operation for this. More...
 
pi_result hip_piPlatformsGet (pi_uint32 num_entries, pi_platform *platforms, pi_uint32 *num_platforms)
 Obtains the HIP platform. More...
 
pi_result hip_piPlatformGetInfo (pi_platform platform, pi_platform_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
 
pi_result hip_piDevicesGet (pi_platform platform, pi_device_type device_type, pi_uint32 num_entries, pi_device *devices, pi_uint32 *num_devices)
 
pi_result hip_piDeviceRetain (pi_device device)
 
pi_result hip_piContextGetInfo (pi_context context, pi_context_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
 
pi_result hip_piContextRetain (pi_context context)
 
pi_result hip_piextContextSetExtendedDeleter (pi_context context, pi_context_extended_deleter function, void *user_data)
 
pi_result hip_piDevicePartition (pi_device device, const cl_device_partition_property *properties, pi_uint32 num_devices, pi_device *out_devices, pi_uint32 *out_num_devices)
 Not applicable to HIP, devices cannot be partitioned. More...
 
pi_result hip_piextDeviceSelectBinary (pi_device device, pi_device_binary *binaries, pi_uint32 num_binaries, pi_uint32 *selected_binary)
 
pi_result hip_piextGetDeviceFunctionPointer (pi_device device, pi_program program, const char *func_name, pi_uint64 *func_pointer_ret)
 
pi_result hip_piDeviceRelease (pi_device device)
 
pi_result hip_piDeviceGetInfo (pi_device device, pi_device_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
 
pi_result hip_piextDeviceGetNativeHandle (pi_device device, pi_native_handle *nativeHandle)
 Gets the native HIP handle of a PI device object. More...
 
pi_result hip_piextDeviceCreateWithNativeHandle (pi_native_handle nativeHandle, pi_platform platform, pi_device *device)
 Created a PI device object from a HIP device handle. More...
 
pi_result hip_piContextCreate (const pi_context_properties *properties, pi_uint32 num_devices, const pi_device *devices, void(*pfn_notify)(const char *errinfo, const void *private_info, size_t cb, void *user_data), void *user_data, pi_context *retcontext)
 Create a PI HIP context. More...
 
pi_result hip_piContextRelease (pi_context ctxt)
 
pi_result hip_piextContextGetNativeHandle (pi_context context, pi_native_handle *nativeHandle)
 Gets the native HIP handle of a PI context object. More...
 
pi_result hip_piextContextCreateWithNativeHandle (pi_native_handle nativeHandle, pi_uint32 num_devices, const pi_device *devices, bool ownNativeHandle, pi_context *context)
 Created a PI context object from a HIP context handle. More...
 
pi_result hip_piMemBufferCreate (pi_context context, pi_mem_flags flags, size_t size, void *host_ptr, pi_mem *ret_mem, const pi_mem_properties *properties)
 Creates a PI Memory object using a HIP memory allocation. More...
 
pi_result hip_piMemRelease (pi_mem memObj)
 Decreases the reference count of the Mem object. More...
 
pi_result hip_piMemBufferPartition (pi_mem parent_buffer, pi_mem_flags flags, pi_buffer_create_type buffer_create_type, void *buffer_create_info, pi_mem *memObj)
 Implements a buffer partition in the HIP backend. More...
 
pi_result hip_piMemGetInfo (pi_mem memObj, pi_mem_info queriedInfo, size_t expectedQuerySize, void *queryOutput, size_t *writtenQuerySize)
 
pi_result hip_piextMemGetNativeHandle (pi_mem mem, pi_native_handle *nativeHandle)
 Gets the native HIP handle of a PI mem object. More...
 
pi_result hip_piextMemCreateWithNativeHandle (pi_native_handle nativeHandle, pi_context context, bool ownNativeHandle, pi_mem *mem)
 Created a PI mem object from a HIP mem handle. More...
 
pi_result hip_piQueueCreate (pi_context context, pi_device device, pi_queue_properties properties, pi_queue *queue)
 Creates a pi_queue object on the HIP backend. More...
 
pi_result hip_piQueueGetInfo (pi_queue command_queue, pi_queue_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
 
pi_result hip_piQueueRetain (pi_queue command_queue)
 
pi_result hip_piQueueRelease (pi_queue command_queue)
 
pi_result hip_piQueueFinish (pi_queue command_queue)
 
pi_result hip_piQueueFlush (pi_queue command_queue)
 
pi_result hip_piextQueueGetNativeHandle (pi_queue queue, pi_native_handle *nativeHandle)
 Gets the native HIP handle of a PI queue object. More...
 
pi_result hip_piextQueueCreateWithNativeHandle (pi_native_handle nativeHandle, pi_context context, pi_device device, bool ownNativeHandle, pi_queue *queue)
 Created a PI queue object from a HIP queue handle. More...
 
pi_result hip_piEnqueueMemBufferWrite (pi_queue command_queue, pi_mem buffer, pi_bool blocking_write, size_t offset, size_t size, void *ptr, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event)
 
pi_result hip_piEnqueueMemBufferRead (pi_queue command_queue, pi_mem buffer, pi_bool blocking_read, size_t offset, size_t size, void *ptr, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event)
 
pi_result hip_piEventsWait (pi_uint32 num_events, const pi_event *event_list)
 
pi_result hip_piKernelCreate (pi_program program, const char *kernel_name, pi_kernel *kernel)
 
pi_result hip_piKernelSetArg (pi_kernel kernel, pi_uint32 arg_index, size_t arg_size, const void *arg_value)
 
pi_result hip_piextKernelSetArgMemObj (pi_kernel kernel, pi_uint32 arg_index, const pi_mem *arg_value)
 
pi_result hip_piextKernelSetArgSampler (pi_kernel kernel, pi_uint32 arg_index, const pi_sampler *arg_value)
 
pi_result hip_piEnqueueKernelLaunch (pi_queue command_queue, pi_kernel kernel, pi_uint32 work_dim, const size_t *global_work_offset, const size_t *global_work_size, const size_t *local_work_size, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event)
 
pi_result hip_piEnqueueNativeKernel (pi_queue queue, void(*user_func)(void *), void *args, size_t cb_args, pi_uint32 num_mem_objects, const pi_mem *mem_list, const void **args_mem_loc, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event)
 \TODO Not implemented More...
 
pi_result hip_piMemImageCreate (pi_context context, pi_mem_flags flags, const pi_image_format *image_format, const pi_image_desc *image_desc, void *host_ptr, pi_mem *ret_mem)
 \TODO Not implemented More...
 
pi_result hip_piMemImageGetInfo (pi_mem image, pi_image_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
 \TODO Not implemented More...
 
pi_result hip_piMemRetain (pi_mem mem)
 
pi_result hip_piclProgramCreateWithSource (pi_context context, pi_uint32 count, const char **strings, const size_t *lengths, pi_program *program)
 Not used as HIP backend only creates programs from binary. More...
 
pi_result hip_piProgramBuild (pi_program program, pi_uint32 num_devices, const pi_device *device_list, const char *options, void(*pfn_notify)(pi_program program, void *user_data), void *user_data)
 Loads the images from a PI program into a HIPmodule that can be used later on to extract functions (kernels). More...
 
pi_result hip_piProgramCreate (pi_context context, const void *il, size_t length, pi_program *res_program)
 \TODO Not implemented More...
 
pi_result hip_piProgramCreateWithBinary (pi_context context, pi_uint32 num_devices, const pi_device *device_list, const size_t *lengths, const unsigned char **binaries, size_t num_metadata_entries, const pi_device_binary_property *metadata, pi_int32 *binary_status, pi_program *program)
 Loads images from a list of PTX or HIPBIN binaries. More...
 
pi_result hip_piProgramGetInfo (pi_program program, pi_program_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
 
pi_result hip_piProgramLink (pi_context context, pi_uint32 num_devices, const pi_device *device_list, const char *options, pi_uint32 num_input_programs, const pi_program *input_programs, void(*pfn_notify)(pi_program program, void *user_data), void *user_data, pi_program *ret_program)
 
pi_result hip_piProgramCompile (pi_program program, pi_uint32 num_devices, const pi_device *device_list, const char *options, pi_uint32 num_input_headers, const pi_program *input_headers, const char **header_include_names, void(*pfn_notify)(pi_program program, void *user_data), void *user_data)
 Creates a new program that is the outcome of the compilation of the headers and the program. More...
 
pi_result hip_piProgramGetBuildInfo (pi_program program, pi_device device, cl_program_build_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
 
pi_result hip_piProgramRetain (pi_program program)
 
pi_result hip_piProgramRelease (pi_program program)
 Decreases the reference count of a pi_program object. More...
 
pi_result hip_piextProgramGetNativeHandle (pi_program program, pi_native_handle *nativeHandle)
 Gets the native HIP handle of a PI program object. More...
 
pi_result hip_piextProgramCreateWithNativeHandle (pi_native_handle nativeHandle, pi_context context, bool ownNativeHandle, pi_program *program)
 Created a PI program object from a HIP program handle. More...
 
pi_result hip_piKernelGetInfo (pi_kernel kernel, pi_kernel_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
 
pi_result hip_piKernelGetGroupInfo (pi_kernel kernel, pi_device device, pi_kernel_group_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
 
pi_result hip_piKernelGetSubGroupInfo (pi_kernel kernel, pi_device device, pi_kernel_sub_group_info param_name, size_t input_value_size, const void *input_value, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
 
pi_result hip_piKernelRetain (pi_kernel kernel)
 
pi_result hip_piKernelRelease (pi_kernel kernel)
 
pi_result hip_piKernelSetExecInfo (pi_kernel kernel, pi_kernel_exec_info param_name, size_t param_value_size, const void *param_value)
 
pi_result hip_piextProgramSetSpecializationConstant (pi_program, pi_uint32, size_t, const void *)
 
pi_result hip_piextKernelSetArgPointer (pi_kernel kernel, pi_uint32 arg_index, size_t arg_size, const void *arg_value)
 
pi_result hip_piEventCreate (pi_context context, pi_event *event)
 
pi_result hip_piEventGetInfo (pi_event event, pi_event_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
 
pi_result hip_piEventGetProfilingInfo (pi_event event, pi_profiling_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
 Obtain profiling information from PI HIP events \TODO Untie from OpenCL, timings from HIP are only elapsed time. More...
 
pi_result hip_piEventSetCallback (pi_event event, pi_int32 command_exec_callback_type, pfn_notify notify, void *user_data)
 
pi_result hip_piEventSetStatus (pi_event event, pi_int32 execution_status)
 
pi_result hip_piextEventGetNativeHandle (pi_event event, pi_native_handle *nativeHandle)
 Gets the native HIP handle of a PI event object. More...
 
pi_result hip_piextEventCreateWithNativeHandle (pi_native_handle nativeHandle, pi_context context, bool ownNativeHandle, pi_event *event)
 Created a PI event object from a HIP event handle. More...
 
pi_result hip_piSamplerCreate (pi_context context, const pi_sampler_properties *sampler_properties, pi_sampler *result_sampler)
 Creates a PI sampler object. More...
 
pi_result hip_piSamplerGetInfo (pi_sampler sampler, cl_sampler_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
 Gets information from a PI sampler object. More...
 
pi_result hip_piSamplerRetain (pi_sampler sampler)
 Retains a PI sampler object, incrementing its reference count. More...
 
pi_result hip_piSamplerRelease (pi_sampler sampler)
 Releases a PI sampler object, decrementing its reference count. More...
 
static pi_result commonEnqueueMemBufferCopyRect (hipStream_t hip_stream, pi_buff_rect_region region, const void *src_ptr, const hipMemoryType src_type, pi_buff_rect_offset src_offset, size_t src_row_pitch, size_t src_slice_pitch, void *dst_ptr, const hipMemoryType dst_type, pi_buff_rect_offset dst_offset, size_t dst_row_pitch, size_t dst_slice_pitch)
 General 3D memory copy operation. More...
 
pi_result hip_piEnqueueMemBufferReadRect (pi_queue command_queue, pi_mem buffer, pi_bool blocking_read, pi_buff_rect_offset buffer_offset, pi_buff_rect_offset host_offset, pi_buff_rect_region region, size_t buffer_row_pitch, size_t buffer_slice_pitch, size_t host_row_pitch, size_t host_slice_pitch, void *ptr, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event)
 
pi_result hip_piEnqueueMemBufferWriteRect (pi_queue command_queue, pi_mem buffer, pi_bool blocking_write, pi_buff_rect_offset buffer_offset, pi_buff_rect_offset host_offset, pi_buff_rect_region region, size_t buffer_row_pitch, size_t buffer_slice_pitch, size_t host_row_pitch, size_t host_slice_pitch, const void *ptr, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event)
 
pi_result hip_piEnqueueMemBufferCopy (pi_queue command_queue, pi_mem src_buffer, pi_mem dst_buffer, size_t src_offset, size_t dst_offset, size_t size, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event)
 
pi_result hip_piEnqueueMemBufferCopyRect (pi_queue command_queue, pi_mem src_buffer, pi_mem dst_buffer, pi_buff_rect_offset src_origin, pi_buff_rect_offset dst_origin, pi_buff_rect_region region, size_t src_row_pitch, size_t src_slice_pitch, size_t dst_row_pitch, size_t dst_slice_pitch, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event)
 
pi_result hip_piEnqueueMemBufferFill (pi_queue command_queue, pi_mem buffer, const void *pattern, size_t pattern_size, size_t offset, size_t size, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event)
 
static size_t imageElementByteSize (hipArray_Format array_format)
 
static pi_result commonEnqueueMemImageNDCopy (hipStream_t hip_stream, pi_mem_type img_type, const size_t *region, const void *src_ptr, const hipMemoryType src_type, const size_t *src_offset, void *dst_ptr, const hipMemoryType dst_type, const size_t *dst_offset)
 General ND memory copy operation for images (where N > 1). More...
 
pi_result hip_piEnqueueMemImageRead (pi_queue command_queue, pi_mem image, pi_bool blocking_read, const size_t *origin, const size_t *region, size_t row_pitch, size_t slice_pitch, void *ptr, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event)
 
pi_result hip_piEnqueueMemImageWrite (pi_queue command_queue, pi_mem image, pi_bool blocking_write, const size_t *origin, const size_t *region, size_t input_row_pitch, size_t input_slice_pitch, const void *ptr, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event)
 
pi_result hip_piEnqueueMemImageCopy (pi_queue command_queue, pi_mem src_image, pi_mem dst_image, const size_t *src_origin, const size_t *dst_origin, const size_t *region, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event)
 
pi_result hip_piEnqueueMemImageFill (pi_queue command_queue, pi_mem image, const void *fill_color, const size_t *origin, const size_t *region, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event)
 \TODO Not implemented in HIP, requires untie from OpenCL More...
 
pi_result hip_piEnqueueMemBufferMap (pi_queue command_queue, pi_mem buffer, pi_bool blocking_map, pi_map_flags map_flags, size_t offset, size_t size, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event, void **ret_map)
 Implements mapping on the host using a BufferRead operation. More...
 
pi_result hip_piEnqueueMemUnmap (pi_queue command_queue, pi_mem memobj, void *mapped_ptr, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event)
 Implements the unmap from the host, using a BufferWrite operation. More...
 
pi_result hip_piextUSMHostAlloc (void **result_ptr, pi_context context, pi_usm_mem_properties *properties, size_t size, pi_uint32 alignment)
 USM: Implements USM Host allocations using HIP Pinned Memory. More...
 
pi_result hip_piextUSMDeviceAlloc (void **result_ptr, pi_context context, pi_device device, pi_usm_mem_properties *properties, size_t size, pi_uint32 alignment)
 USM: Implements USM device allocations using a normal HIP device pointer. More...
 
pi_result hip_piextUSMSharedAlloc (void **result_ptr, pi_context context, pi_device device, pi_usm_mem_properties *properties, size_t size, pi_uint32 alignment)
 USM: Implements USM Shared allocations using HIP Managed Memory. More...
 
pi_result hip_piextUSMFree (pi_context context, void *ptr)
 USM: Frees the given USM pointer associated with the context. More...
 
pi_result hip_piextUSMEnqueueMemset (pi_queue queue, void *ptr, pi_int32 value, size_t count, pi_uint32 num_events_in_waitlist, const pi_event *events_waitlist, pi_event *event)
 
pi_result hip_piextUSMEnqueueMemcpy (pi_queue queue, pi_bool blocking, void *dst_ptr, const void *src_ptr, size_t size, pi_uint32 num_events_in_waitlist, const pi_event *events_waitlist, pi_event *event)
 
pi_result hip_piextUSMEnqueuePrefetch (pi_queue queue, const void *ptr, size_t size, pi_usm_migration_flags flags, pi_uint32 num_events_in_waitlist, const pi_event *events_waitlist, pi_event *event)
 
pi_result hip_piextUSMEnqueueMemAdvise (pi_queue queue, const void *ptr, size_t length, pi_mem_advice advice, pi_event *event)
 USM: memadvise API to govern behavior of automatic migration mechanisms. More...
 
pi_result hip_piextUSMGetMemAllocInfo (pi_context context, const void *ptr, pi_mem_alloc_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
 API to query information about USM allocated pointers Valid Queries: PI_MEM_ALLOC_TYPE returns host/device/shared pi_host_usm value PI_MEM_ALLOC_BASE_PTR returns the base ptr of an allocation if the queried pointer fell inside an allocation. More...
 
pi_result hip_piTearDown (void *PluginParameter)
 
pi_result piPluginInit (pi_plugin *PluginInit)
 

Variables

const char SupportedVersion [] = _PI_H_VERSION_STRING
 

Detailed Description

Implementation of HIP Plugin.

Definition in file pi_hip.cpp.

Macro Definition Documentation

◆ _PI_CL

#define _PI_CL (   pi_api,
  hip_api 
)    (PluginInit->PiFunctionTable).pi_api = (decltype(&::pi_api))(&hip_api);

Function Documentation

◆ commonEnqueueMemBufferCopyRect()

static pi_result commonEnqueueMemBufferCopyRect ( hipStream_t  hip_stream,
pi_buff_rect_region  region,
const void *  src_ptr,
const hipMemoryType  src_type,
pi_buff_rect_offset  src_offset,
size_t  src_row_pitch,
size_t  src_slice_pitch,
void *  dst_ptr,
const hipMemoryType  dst_type,
pi_buff_rect_offset  dst_offset,
size_t  dst_row_pitch,
size_t  dst_slice_pitch 
)
static

General 3D memory copy operation.

This function requires the corresponding HIP context to be at the top of the context stack If the source and/or destination is on the device, src_ptr and/or dst_ptr must be a pointer to a hipDevPtr

Definition at line 3754 of file pi_hip.cpp.

References pi_buff_rect_region_struct::depth_scalar, pi_buff_rect_region_struct::height_scalar, PI_SUCCESS, pi_buff_rect_region_struct::width_bytes, pi_buff_rect_offset_struct::x_bytes, pi_buff_rect_offset_struct::y_scalar, and pi_buff_rect_offset_struct::z_scalar.

Referenced by hip_piEnqueueMemBufferCopyRect(), hip_piEnqueueMemBufferReadRect(), and hip_piEnqueueMemBufferWriteRect().

◆ commonEnqueueMemImageNDCopy()

static pi_result commonEnqueueMemImageNDCopy ( hipStream_t  hip_stream,
pi_mem_type  img_type,
const size_t *  region,
const void *  src_ptr,
const hipMemoryType  src_type,
const size_t *  src_offset,
void *  dst_ptr,
const hipMemoryType  dst_type,
const size_t *  dst_offset 
)
static

General ND memory copy operation for images (where N > 1).

This function requires the corresponding HIP context to be at the top of the context stack If the source and/or destination is an array, src_ptr and/or dst_ptr must be a pointer to a hipArray

Definition at line 4142 of file pi_hip.cpp.

References PI_ERROR_UNKNOWN, PI_INVALID_VALUE, PI_MEM_TYPE_IMAGE2D, and PI_MEM_TYPE_IMAGE3D.

Referenced by hip_piEnqueueMemImageCopy(), hip_piEnqueueMemImageRead(), and hip_piEnqueueMemImageWrite().

◆ enqueueEventWait()

pi_result enqueueEventWait ( pi_queue  queue,
pi_event  event 
)

Definition at line 545 of file pi_hip.cpp.

Referenced by hip_piEnqueueEventsWaitWithBarrier().

◆ getKernelNames()

std::string getKernelNames ( pi_program  program)

Finds kernel names by searching for entry points in the PTX source, as the HIP driver API doesn't expose an operation for this.

Note: This is currently only being used by the SYCL program class for the has_kernel method, so an alternative would be to move the has_kernel query to PI and use hipModuleGetFunction to check for a kernel.

Definition at line 608 of file pi_hip.cpp.

References cl::sycl::detail::pi::die().

Referenced by hip_piProgramGetInfo().

◆ hip_piclProgramCreateWithSource()

pi_result hip_piclProgramCreateWithSource ( pi_context  context,
pi_uint32  count,
const char **  strings,
const size_t *  lengths,
pi_program program 
)

Not used as HIP backend only creates programs from binary.

See hip_piclProgramCreateWithBinary.

Definition at line 2891 of file pi_hip.cpp.

References cl::sycl::detail::pi::hipPrint(), and PI_INVALID_OPERATION.

Referenced by piPluginInit().

◆ hip_piContextCreate()

pi_result hip_piContextCreate ( const pi_context_properties properties,
pi_uint32  num_devices,
const pi_device devices,
void(*)(const char *errinfo, const void *private_info, size_t cb, void *user_data)  pfn_notify,
void *  user_data,
pi_context retcontext 
)

Create a PI HIP context.

By default creates a scoped context and keeps the last active HIP context on top of the HIP context stack. With the __SYCL_PI_CONTEXT_PROPERTIES_HIP_PRIMARY key/id and a value of PI_TRUE creates a primary HIP context and activates it on the HIP context stack.

Parameters
[in]properties0 terminated array of key/id-value combinations. Can be nullptr. Only accepts property key/id __SYCL_PI_CONTEXT_PROPERTIES_HIP_PRIMARY with a pi_bool value.
[in]num_devicesNumber of devices to create the context for.
[in]devicesDevices to create the context for.
[in]pfn_notifyCallback, currently unused.
[in]user_dataUser data for callback.
[out]retcontextSet to created context on success.
Returns
PI_SUCCESS on success, otherwise an error return code.

Definition at line 1733 of file pi_hip.cpp.

References __SYCL_PI_CONTEXT_PROPERTIES_HIP_PRIMARY, cl::sycl::detail::pi::die(), std::get(), PI_FALSE, PI_INVALID_VALUE, PI_OUT_OF_RESOURCES, PI_SUCCESS, PI_TRUE, _pi_context::primary, and _pi_context::user_defined.

Referenced by piPluginInit().

◆ hip_piContextGetInfo()

pi_result hip_piContextGetInfo ( pi_context  context,
pi_context_info  param_name,
size_t  param_value_size,
void *  param_value,
size_t *  param_value_size_ret 
)

◆ hip_piContextRelease()

◆ hip_piContextRetain()

pi_result hip_piContextRetain ( pi_context  context)

Definition at line 875 of file pi_hip.cpp.

References PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piDeviceGetInfo()

pi_result hip_piDeviceGetInfo ( pi_device  device,
pi_device_info  param_name,
size_t  param_value_size,
void *  param_value,
size_t *  param_value_size_ret 
)

Definition at line 969 of file pi_hip.cpp.

References __SYCL_PI_HANDLE_UNKNOWN_PARAM_NAME, cl::sycl::detail::pi::assertion(), cl::sycl::detail::pi::die(), min(), PI_DEVICE_INFO_ADDRESS_BITS, PI_DEVICE_INFO_ATOMIC_64, PI_DEVICE_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES, PI_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES, PI_DEVICE_INFO_AVAILABLE, PI_DEVICE_INFO_BUILD_ON_SUBDEVICE, PI_DEVICE_INFO_BUILT_IN_KERNELS, PI_DEVICE_INFO_COMPILER_AVAILABLE, PI_DEVICE_INFO_DOUBLE_FP_CONFIG, PI_DEVICE_INFO_DRIVER_VERSION, PI_DEVICE_INFO_ENDIAN_LITTLE, PI_DEVICE_INFO_ERROR_CORRECTION_SUPPORT, PI_DEVICE_INFO_EXECUTION_CAPABILITIES, PI_DEVICE_INFO_EXTENSION_DEVICELIB_ASSERT, PI_DEVICE_INFO_EXTENSIONS, PI_DEVICE_INFO_GLOBAL_MEM_CACHE_SIZE, PI_DEVICE_INFO_GLOBAL_MEM_CACHE_TYPE, PI_DEVICE_INFO_GLOBAL_MEM_CACHELINE_SIZE, PI_DEVICE_INFO_GLOBAL_MEM_SIZE, PI_DEVICE_INFO_GPU_EU_COUNT, PI_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE, PI_DEVICE_INFO_GPU_EU_SIMD_WIDTH, PI_DEVICE_INFO_GPU_HW_THREADS_PER_EU, PI_DEVICE_INFO_GPU_SLICES, PI_DEVICE_INFO_GPU_SUBSLICES_PER_SLICE, PI_DEVICE_INFO_HALF_FP_CONFIG, PI_DEVICE_INFO_HOST_UNIFIED_MEMORY, PI_DEVICE_INFO_IMAGE2D_MAX_HEIGHT, PI_DEVICE_INFO_IMAGE2D_MAX_WIDTH, PI_DEVICE_INFO_IMAGE3D_MAX_DEPTH, PI_DEVICE_INFO_IMAGE3D_MAX_HEIGHT, PI_DEVICE_INFO_IMAGE3D_MAX_WIDTH, PI_DEVICE_INFO_IMAGE_MAX_ARRAY_SIZE, PI_DEVICE_INFO_IMAGE_MAX_BUFFER_SIZE, PI_DEVICE_INFO_IMAGE_SUPPORT, PI_DEVICE_INFO_LINKER_AVAILABLE, PI_DEVICE_INFO_LOCAL_MEM_SIZE, PI_DEVICE_INFO_LOCAL_MEM_TYPE, PI_DEVICE_INFO_MAX_CLOCK_FREQUENCY, PI_DEVICE_INFO_MAX_COMPUTE_UNITS, PI_DEVICE_INFO_MAX_CONSTANT_ARGS, PI_DEVICE_INFO_MAX_CONSTANT_BUFFER_SIZE, PI_DEVICE_INFO_MAX_MEM_ALLOC_SIZE, PI_DEVICE_INFO_MAX_MEM_BANDWIDTH, PI_DEVICE_INFO_MAX_NUM_SUB_GROUPS, PI_DEVICE_INFO_MAX_PARAMETER_SIZE, PI_DEVICE_INFO_MAX_READ_IMAGE_ARGS, PI_DEVICE_INFO_MAX_SAMPLERS, PI_DEVICE_INFO_MAX_WORK_GROUP_SIZE, PI_DEVICE_INFO_MAX_WORK_ITEM_DIMENSIONS, PI_DEVICE_INFO_MAX_WORK_ITEM_SIZES, PI_DEVICE_INFO_MAX_WRITE_IMAGE_ARGS, PI_DEVICE_INFO_MEM_BASE_ADDR_ALIGN, PI_DEVICE_INFO_NAME, PI_DEVICE_INFO_NATIVE_VECTOR_WIDTH_CHAR, PI_DEVICE_INFO_NATIVE_VECTOR_WIDTH_DOUBLE, PI_DEVICE_INFO_NATIVE_VECTOR_WIDTH_FLOAT, PI_DEVICE_INFO_NATIVE_VECTOR_WIDTH_HALF, PI_DEVICE_INFO_NATIVE_VECTOR_WIDTH_INT, PI_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG, PI_DEVICE_INFO_NATIVE_VECTOR_WIDTH_SHORT, PI_DEVICE_INFO_OPENCL_C_VERSION, PI_DEVICE_INFO_PARENT_DEVICE, PI_DEVICE_INFO_PARTITION_AFFINITY_DOMAIN, PI_DEVICE_INFO_PARTITION_MAX_SUB_DEVICES, PI_DEVICE_INFO_PARTITION_PROPERTIES, PI_DEVICE_INFO_PARTITION_TYPE, PI_DEVICE_INFO_PCI_ADDRESS, PI_DEVICE_INFO_PLATFORM, PI_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC, PI_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_CHAR, PI_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_DOUBLE, PI_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_FLOAT, PI_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_HALF, PI_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_INT, PI_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG, PI_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_SHORT, PI_DEVICE_INFO_PRINTF_BUFFER_SIZE, PI_DEVICE_INFO_PROFILE, PI_DEVICE_INFO_PROFILING_TIMER_RESOLUTION, PI_DEVICE_INFO_QUEUE_ON_DEVICE_PROPERTIES, PI_DEVICE_INFO_QUEUE_ON_HOST_PROPERTIES, PI_DEVICE_INFO_REFERENCE_COUNT, PI_DEVICE_INFO_SINGLE_FP_CONFIG, PI_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS, PI_DEVICE_INFO_SUB_GROUP_SIZES_INTEL, PI_DEVICE_INFO_TYPE, PI_DEVICE_INFO_USM_CROSS_SHARED_SUPPORT, PI_DEVICE_INFO_USM_DEVICE_SUPPORT, PI_DEVICE_INFO_USM_HOST_SUPPORT, PI_DEVICE_INFO_USM_SINGLE_SHARED_SUPPORT, PI_DEVICE_INFO_USM_SYSTEM_SHARED_SUPPORT, PI_DEVICE_INFO_VENDOR, PI_DEVICE_INFO_VENDOR_ID, PI_DEVICE_INFO_VERSION, PI_DEVICE_LOCAL_MEM_TYPE_LOCAL, PI_DEVICE_TYPE_GPU, PI_EXT_ONEAPI_DEVICE_INFO_MAX_WORK_GROUPS_3D, PI_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT, PI_FP_DENORM, PI_FP_FMA, PI_FP_INF_NAN, PI_FP_ROUND_TO_INF, PI_FP_ROUND_TO_NEAREST, PI_FP_ROUND_TO_ZERO, PI_INVALID_VALUE, PI_TRUE, PI_USM_ACCESS, PI_USM_ATOMIC_ACCESS, PI_USM_CONCURRENT_ACCESS, and PI_USM_CONCURRENT_ATOMIC_ACCESS.

Referenced by hip_piEnqueueKernelLaunch(), and piPluginInit().

◆ hip_piDevicePartition()

pi_result hip_piDevicePartition ( pi_device  device,
const cl_device_partition_property *  properties,
pi_uint32  num_devices,
pi_device out_devices,
pi_uint32 out_num_devices 
)

Not applicable to HIP, devices cannot be partitioned.

Definition at line 891 of file pi_hip.cpp.

References PI_INVALID_OPERATION.

Referenced by piPluginInit().

◆ hip_piDeviceRelease()

pi_result hip_piDeviceRelease ( pi_device  device)
Returns
PI_SUCCESS always since HIP devices are always root devices.

Definition at line 964 of file pi_hip.cpp.

References PI_SUCCESS.

Referenced by piPluginInit(), _pi_context::~_pi_context(), and _pi_queue::~_pi_queue().

◆ hip_piDeviceRetain()

pi_result hip_piDeviceRetain ( pi_device  device)
Returns
PI_SUCCESS if the function is exehipted successfully HIP devices are always root devices so retain always returns success.

Definition at line 849 of file pi_hip.cpp.

References PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piDevicesGet()

pi_result hip_piDevicesGet ( pi_platform  platform,
pi_device_type  device_type,
pi_uint32  num_entries,
pi_device devices,
pi_uint32 num_devices 
)
Parameters
devicesList of devices available on the system
num_devicesNumber of elements in the list of devices Requesting a non-GPU device triggers an error, all PI HIP devices are GPUs.

Definition at line 817 of file pi_hip.cpp.

References PI_DEVICE_TYPE_DEFAULT, PI_DEVICE_TYPE_GPU, PI_OUT_OF_RESOURCES, and PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piEnqueueEventsWait()

pi_result hip_piEnqueueEventsWait ( pi_queue  command_queue,
pi_uint32  num_events_in_wait_list,
const pi_event event_wait_list,
pi_event event 
)

Enqueues a wait on the given queue for all events.

See enqueueEventWait

Currently queues are represented by a single in-order stream, therefore every command is an implicit barrier and so hip_piEnqueueEventsWait has the same behavior as hip_piEnqueueEventsWaitWithBarrier. So hip_piEnqueueEventsWait can just call hip_piEnqueueEventsWaitWithBarrier.

Definition at line 3530 of file pi_hip.cpp.

References hip_piEnqueueEventsWaitWithBarrier().

Referenced by hip_piEnqueueKernelLaunch(), hip_piEnqueueMemBufferCopy(), hip_piEnqueueMemBufferCopyRect(), hip_piEnqueueMemBufferFill(), hip_piEnqueueMemBufferMap(), hip_piEnqueueMemBufferRead(), hip_piEnqueueMemBufferReadRect(), hip_piEnqueueMemBufferWrite(), hip_piEnqueueMemBufferWriteRect(), hip_piEnqueueMemImageCopy(), hip_piEnqueueMemImageRead(), hip_piEnqueueMemImageWrite(), hip_piEnqueueMemUnmap(), hip_piextUSMEnqueueMemAdvise(), hip_piextUSMEnqueueMemcpy(), hip_piextUSMEnqueueMemset(), hip_piextUSMEnqueuePrefetch(), and piPluginInit().

◆ hip_piEnqueueEventsWaitWithBarrier()

pi_result hip_piEnqueueEventsWaitWithBarrier ( pi_queue  command_queue,
pi_uint32  num_events_in_wait_list,
const pi_event event_wait_list,
pi_event event 
)

Enqueues a wait on the given queue for all specified events.

See enqueueEventWaitWithBarrier

If the events list is empty, the enqueued wait will wait on all previous events in the queue.

Definition at line 3543 of file pi_hip.cpp.

References enqueueEventWait(), _pi_queue::get_context(), _pi_event::make_native(), PI_COMMAND_TYPE_MARKER, PI_ERROR_UNKNOWN, PI_INVALID_QUEUE, and PI_SUCCESS.

Referenced by hip_piEnqueueEventsWait(), and piPluginInit().

◆ hip_piEnqueueKernelLaunch()

pi_result hip_piEnqueueKernelLaunch ( pi_queue  command_queue,
pi_kernel  kernel,
pi_uint32  work_dim,
const size_t *  global_work_offset,
const size_t *  global_work_size,
const size_t *  local_work_size,
pi_uint32  num_events_in_wait_list,
const pi_event event_wait_list,
pi_event event 
)

◆ hip_piEnqueueMemBufferCopy()

pi_result hip_piEnqueueMemBufferCopy ( pi_queue  command_queue,
pi_mem  src_buffer,
pi_mem  dst_buffer,
size_t  src_offset,
size_t  dst_offset,
size_t  size,
pi_uint32  num_events_in_wait_list,
const pi_event event_wait_list,
pi_event event 
)

◆ hip_piEnqueueMemBufferCopyRect()

pi_result hip_piEnqueueMemBufferCopyRect ( pi_queue  command_queue,
pi_mem  src_buffer,
pi_mem  dst_buffer,
pi_buff_rect_offset  src_origin,
pi_buff_rect_offset  dst_origin,
pi_buff_rect_region  region,
size_t  src_row_pitch,
size_t  src_slice_pitch,
size_t  dst_row_pitch,
size_t  dst_slice_pitch,
pi_uint32  num_events_in_wait_list,
const pi_event event_wait_list,
pi_event event 
)

◆ hip_piEnqueueMemBufferFill()

pi_result hip_piEnqueueMemBufferFill ( pi_queue  command_queue,
pi_mem  buffer,
const void *  pattern,
size_t  pattern_size,
size_t  offset,
size_t  size,
pi_uint32  num_events_in_wait_list,
const pi_event event_wait_list,
pi_event event 
)

◆ hip_piEnqueueMemBufferMap()

pi_result hip_piEnqueueMemBufferMap ( pi_queue  command_queue,
pi_mem  buffer,
pi_bool  blocking_map,
pi_map_flags  map_flags,
size_t  offset,
size_t  size,
pi_uint32  num_events_in_wait_list,
const pi_event event_wait_list,
pi_event event,
void **  ret_map 
)

Implements mapping on the host using a BufferRead operation.

Mapped pointers are stored in the pi_mem object. If the buffer uses pinned host memory a pointer to that memory is returned and no read operation is done. \TODO Untie types from OpenCL

Definition at line 4444 of file pi_hip.cpp.

References _pi_mem::mem_::buffer_mem_::alloc_host_ptr, _pi_mem::mem_::buffer_mem_::allocMode_, _pi_mem::buffer, _pi_mem::mem_::buffer_mem_, _pi_queue::get_context(), _pi_mem::mem_::buffer_mem_::get_map_ptr(), hip_piEnqueueEventsWait(), hip_piEnqueueMemBufferRead(), _pi_event::make_native(), _pi_mem::mem_::buffer_mem_::map_to_ptr(), _pi_mem::mem_, _pi_mem::mem_type_, PI_COMMAND_TYPE_MEM_BUFFER_MAP, PI_INVALID_OPERATION, PI_MAP_READ, PI_MAP_WRITE, and PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piEnqueueMemBufferRead()

pi_result hip_piEnqueueMemBufferRead ( pi_queue  command_queue,
pi_mem  buffer,
pi_bool  blocking_read,
size_t  offset,
size_t  size,
void *  ptr,
pi_uint32  num_events_in_wait_list,
const pi_event event_wait_list,
pi_event event 
)

◆ hip_piEnqueueMemBufferReadRect()

pi_result hip_piEnqueueMemBufferReadRect ( pi_queue  command_queue,
pi_mem  buffer,
pi_bool  blocking_read,
pi_buff_rect_offset  buffer_offset,
pi_buff_rect_offset  host_offset,
pi_buff_rect_region  region,
size_t  buffer_row_pitch,
size_t  buffer_slice_pitch,
size_t  host_row_pitch,
size_t  host_slice_pitch,
void *  ptr,
pi_uint32  num_events_in_wait_list,
const pi_event event_wait_list,
pi_event event 
)

◆ hip_piEnqueueMemBufferWrite()

pi_result hip_piEnqueueMemBufferWrite ( pi_queue  command_queue,
pi_mem  buffer,
pi_bool  blocking_write,
size_t  offset,
size_t  size,
void *  ptr,
pi_uint32  num_events_in_wait_list,
const pi_event event_wait_list,
pi_event event 
)

◆ hip_piEnqueueMemBufferWriteRect()

pi_result hip_piEnqueueMemBufferWriteRect ( pi_queue  command_queue,
pi_mem  buffer,
pi_bool  blocking_write,
pi_buff_rect_offset  buffer_offset,
pi_buff_rect_offset  host_offset,
pi_buff_rect_region  region,
size_t  buffer_row_pitch,
size_t  buffer_slice_pitch,
size_t  host_row_pitch,
size_t  host_slice_pitch,
const void *  ptr,
pi_uint32  num_events_in_wait_list,
const pi_event event_wait_list,
pi_event event 
)

◆ hip_piEnqueueMemImageCopy()

pi_result hip_piEnqueueMemImageCopy ( pi_queue  command_queue,
pi_mem  src_image,
pi_mem  dst_image,
const size_t *  src_origin,
const size_t *  dst_origin,
const size_t *  region,
pi_uint32  num_events_in_wait_list,
const pi_event event_wait_list,
pi_event event 
)

◆ hip_piEnqueueMemImageFill()

pi_result hip_piEnqueueMemImageFill ( pi_queue  command_queue,
pi_mem  image,
const void *  fill_color,
const size_t *  origin,
const size_t *  region,
pi_uint32  num_events_in_wait_list,
const pi_event event_wait_list,
pi_event event 
)

\TODO Not implemented in HIP, requires untie from OpenCL

Definition at line 4419 of file pi_hip.cpp.

References cl::sycl::detail::pi::die().

Referenced by piPluginInit().

◆ hip_piEnqueueMemImageRead()

pi_result hip_piEnqueueMemImageRead ( pi_queue  command_queue,
pi_mem  image,
pi_bool  blocking_read,
const size_t *  origin,
const size_t *  region,
size_t  row_pitch,
size_t  slice_pitch,
void *  ptr,
pi_uint32  num_events_in_wait_list,
const pi_event event_wait_list,
pi_event event 
)

◆ hip_piEnqueueMemImageWrite()

pi_result hip_piEnqueueMemImageWrite ( pi_queue  command_queue,
pi_mem  image,
pi_bool  blocking_write,
const size_t *  origin,
const size_t *  region,
size_t  input_row_pitch,
size_t  input_slice_pitch,
const void *  ptr,
pi_uint32  num_events_in_wait_list,
const pi_event event_wait_list,
pi_event event 
)

◆ hip_piEnqueueMemUnmap()

pi_result hip_piEnqueueMemUnmap ( pi_queue  command_queue,
pi_mem  memobj,
void *  mapped_ptr,
pi_uint32  num_events_in_wait_list,
const pi_event event_wait_list,
pi_event event 
)

◆ hip_piEnqueueNativeKernel()

pi_result hip_piEnqueueNativeKernel ( pi_queue  queue,
void(*)(void *)  user_func,
void *  args,
size_t  cb_args,
pi_uint32  num_mem_objects,
const pi_mem mem_list,
const void **  args_mem_loc,
pi_uint32  num_events_in_wait_list,
const pi_event event_wait_list,
pi_event event 
)

\TODO Not implemented

Definition at line 2692 of file pi_hip.cpp.

References cl::sycl::detail::pi::die().

Referenced by piPluginInit().

◆ hip_piEventCreate()

pi_result hip_piEventCreate ( pi_context  context,
pi_event event 
)

Definition at line 3398 of file pi_hip.cpp.

References cl::sycl::detail::pi::die().

Referenced by piPluginInit().

◆ hip_piEventGetInfo()

pi_result hip_piEventGetInfo ( pi_event  event,
pi_event_info  param_name,
size_t  param_value_size,
void *  param_value,
size_t *  param_value_size_ret 
)

◆ hip_piEventGetProfilingInfo()

pi_result hip_piEventGetProfilingInfo ( pi_event  event,
pi_profiling_info  param_name,
size_t  param_value_size,
void *  param_value,
size_t *  param_value_size_ret 
)

Obtain profiling information from PI HIP events \TODO Untie from OpenCL, timings from HIP are only elapsed time.

Definition at line 3436 of file pi_hip.cpp.

References __SYCL_PI_HANDLE_UNKNOWN_PARAM_NAME, cl::sycl::detail::pi::die(), PI_PROFILING_INFO_COMMAND_END, PI_PROFILING_INFO_COMMAND_QUEUED, PI_PROFILING_INFO_COMMAND_START, PI_PROFILING_INFO_COMMAND_SUBMIT, PI_PROFILING_INFO_NOT_AVAILABLE, and PI_QUEUE_PROFILING_ENABLE.

Referenced by piPluginInit().

◆ hip_piEventRelease()

pi_result hip_piEventRelease ( pi_event  event)

◆ hip_piEventRetain()

pi_result hip_piEventRetain ( pi_event  event)

Definition at line 3487 of file pi_hip.cpp.

References cl::sycl::detail::pi::assertion(), and PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piEventSetCallback()

pi_result hip_piEventSetCallback ( pi_event  event,
pi_int32  command_exec_callback_type,
pfn_notify  notify,
void *  user_data 
)

Definition at line 3467 of file pi_hip.cpp.

References cl::sycl::detail::pi::die(), and PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piEventSetStatus()

pi_result hip_piEventSetStatus ( pi_event  event,
pi_int32  execution_status 
)

Definition at line 3479 of file pi_hip.cpp.

References cl::sycl::detail::pi::die(), and PI_INVALID_VALUE.

Referenced by piPluginInit().

◆ hip_piEventsWait()

pi_result hip_piEventsWait ( pi_uint32  num_events,
const pi_event event_list 
)

◆ hip_piextContextCreateWithNativeHandle()

pi_result hip_piextContextCreateWithNativeHandle ( pi_native_handle  nativeHandle,
pi_uint32  num_devices,
const pi_device devices,
bool  ownNativeHandle,
pi_context context 
)

Created a PI context object from a HIP context handle.

TODO: Implement this. NOTE: The created PI object takes ownership of the native handle.

Parameters
[in]nativeHandleThe native handle to create PI context object from.
[out]contextSet to the PI context object created from native handle.
Returns
TBD

Definition at line 1878 of file pi_hip.cpp.

References cl::sycl::detail::pi::die().

Referenced by piPluginInit().

◆ hip_piextContextGetNativeHandle()

pi_result hip_piextContextGetNativeHandle ( pi_context  context,
pi_native_handle nativeHandle 
)

Gets the native HIP handle of a PI context object.

Parameters
[in]contextThe PI context to get the native HIP object of.
[out]nativeHandleSet to the native handle of the PI context object.
Returns
PI_SUCCESS

Definition at line 1864 of file pi_hip.cpp.

References PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piextContextSetExtendedDeleter()

pi_result hip_piextContextSetExtendedDeleter ( pi_context  context,
pi_context_extended_deleter  function,
void *  user_data 
)

Definition at line 883 of file pi_hip.cpp.

References PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piextDeviceCreateWithNativeHandle()

pi_result hip_piextDeviceCreateWithNativeHandle ( pi_native_handle  nativeHandle,
pi_platform  platform,
pi_device device 
)

Created a PI device object from a HIP device handle.

TODO: Implement this. NOTE: The created PI object takes ownership of the native handle.

Parameters
[in]nativeHandleThe native handle to create PI device object from.
[in]platformis the PI platform of the device.
[out]deviceSet to the PI device object created from native handle.
Returns
TBD

Definition at line 1702 of file pi_hip.cpp.

References cl::sycl::detail::pi::die().

Referenced by piPluginInit().

◆ hip_piextDeviceGetNativeHandle()

pi_result hip_piextDeviceGetNativeHandle ( pi_device  device,
pi_native_handle nativeHandle 
)

Gets the native HIP handle of a PI device object.

Parameters
[in]deviceThe PI device to get the native HIP object of.
[out]nativeHandleSet to the native handle of the PI device object.
Returns
PI_SUCCESS

Definition at line 1687 of file pi_hip.cpp.

References PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piextDeviceSelectBinary()

pi_result hip_piextDeviceSelectBinary ( pi_device  device,
pi_device_binary binaries,
pi_uint32  num_binaries,
pi_uint32 selected_binary 
)
Returns
If available, the first binary that is PTX

Definition at line 906 of file pi_hip.cpp.

References __SYCL_PI_DEVICE_BINARY_TARGET_AMDGCN, __SYCL_PI_DEVICE_BINARY_TARGET_NVPTX64, cl::sycl::detail::pi::die(), PI_INVALID_BINARY, and PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piextEventCreateWithNativeHandle()

pi_result hip_piextEventCreateWithNativeHandle ( pi_native_handle  nativeHandle,
pi_context  context,
bool  ownNativeHandle,
pi_event event 
)

Created a PI event object from a HIP event handle.

TODO: Implement this. NOTE: The created PI object takes ownership of the native handle.

Parameters
[in]nativeHandleThe native handle to create PI event object from.
[out]eventSet to the PI event object created from native handle.
Returns
TBD

Definition at line 3600 of file pi_hip.cpp.

References cl::sycl::detail::pi::die().

Referenced by piPluginInit().

◆ hip_piextEventGetNativeHandle()

pi_result hip_piextEventGetNativeHandle ( pi_event  event,
pi_native_handle nativeHandle 
)

Gets the native HIP handle of a PI event object.

Parameters
[in]eventThe PI event to get the native HIP object of.
[out]nativeHandleSet to the native handle of the PI event object.
Returns
PI_SUCCESS on success. PI_INVALID_EVENT if given a user event.

Definition at line 3586 of file pi_hip.cpp.

References PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piextGetDeviceFunctionPointer()

pi_result hip_piextGetDeviceFunctionPointer ( pi_device  device,
pi_program  program,
const char func_name,
pi_uint64 func_pointer_ret 
)

◆ hip_piextKernelSetArgMemObj()

◆ hip_piextKernelSetArgPointer()

pi_result hip_piextKernelSetArgPointer ( pi_kernel  kernel,
pi_uint32  arg_index,
size_t  arg_size,
const void *  arg_value 
)

Definition at line 3389 of file pi_hip.cpp.

References PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piextKernelSetArgSampler()

pi_result hip_piextKernelSetArgSampler ( pi_kernel  kernel,
pi_uint32  arg_index,
const pi_sampler arg_value 
)

Definition at line 2547 of file pi_hip.cpp.

References PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piextMemCreateWithNativeHandle()

pi_result hip_piextMemCreateWithNativeHandle ( pi_native_handle  nativeHandle,
pi_context  context,
bool  ownNativeHandle,
pi_mem mem 
)

Created a PI mem object from a HIP mem handle.

TODO: Implement this. NOTE: The created PI object takes ownership of the native handle.

Parameters
[in]nativeHandleThe native handle to create PI mem object from.
[in]contextThe PI context of the memory allocation.
[in]ownNativeHandleIndicates if we own the native memory handle or it came from interop that asked to not transfer the ownership to SYCL RT.
[out]memSet to the PI mem object created from native handle.
Returns
TBD

Definition at line 2141 of file pi_hip.cpp.

References cl::sycl::detail::pi::die().

Referenced by piPluginInit().

◆ hip_piextMemGetNativeHandle()

pi_result hip_piextMemGetNativeHandle ( pi_mem  mem,
pi_native_handle nativeHandle 
)

Gets the native HIP handle of a PI mem object.

Parameters
[in]memThe PI mem to get the native HIP object of.
[out]nativeHandleSet to the native handle of the PI mem object.
Returns
PI_SUCCESS

Definition at line 2123 of file pi_hip.cpp.

References _pi_mem::mem_::buffer_mem_, _pi_mem::mem_::buffer_mem_::get(), _pi_mem::mem_, and PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piextProgramCreateWithNativeHandle()

pi_result hip_piextProgramCreateWithNativeHandle ( pi_native_handle  nativeHandle,
pi_context  context,
bool  ownNativeHandle,
pi_program program 
)

Created a PI program object from a HIP program handle.

TODO: Implement this. NOTE: The created PI object takes ownership of the native handle.

Parameters
[in]nativeHandleThe native handle to create PI program object from.
[in]contextThe PI context of the program.
[in]ownNativeHandletells if should assume the ownership of the native handle.
[out]programSet to the PI program object created from native handle.
Returns
TBD

Definition at line 3168 of file pi_hip.cpp.

References cl::sycl::detail::pi::die().

Referenced by piPluginInit().

◆ hip_piextProgramGetNativeHandle()

pi_result hip_piextProgramGetNativeHandle ( pi_program  program,
pi_native_handle nativeHandle 
)

Gets the native HIP handle of a PI program object.

Parameters
[in]programThe PI program to get the native HIP object of.
[out]nativeHandleSet to the native handle of the PI program object.
Returns
TBD

Definition at line 3151 of file pi_hip.cpp.

References _pi_program::get(), and PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piextProgramSetSpecializationConstant()

pi_result hip_piextProgramSetSpecializationConstant ( pi_program  ,
pi_uint32  ,
size_t  ,
const void *   
)

Definition at line 3380 of file pi_hip.cpp.

References cl::sycl::detail::pi::die().

Referenced by piPluginInit().

◆ hip_piextQueueCreateWithNativeHandle()

pi_result hip_piextQueueCreateWithNativeHandle ( pi_native_handle  nativeHandle,
pi_context  context,
pi_device  device,
bool  ownNativeHandle,
pi_queue queue 
)

Created a PI queue object from a HIP queue handle.

TODO: Implement this. NOTE: The created PI object takes ownership of the native handle.

Parameters
[in]nativeHandleThe native handle to create PI queue object from.
[in]contextis the PI context of the queue.
[out]queueSet to the PI queue object created from native handle.
ownNativeHandletells if SYCL RT should assume the ownership of the native handle, if it can.
Returns
TBD

Definition at line 2311 of file pi_hip.cpp.

References cl::sycl::detail::pi::die().

Referenced by piPluginInit().

◆ hip_piextQueueGetNativeHandle()

pi_result hip_piextQueueGetNativeHandle ( pi_queue  queue,
pi_native_handle nativeHandle 
)

Gets the native HIP handle of a PI queue object.

Parameters
[in]queueThe PI queue to get the native HIP object of.
[out]nativeHandleSet to the native handle of the PI queue object.
Returns
PI_SUCCESS

Definition at line 2293 of file pi_hip.cpp.

References PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piextUSMDeviceAlloc()

pi_result hip_piextUSMDeviceAlloc ( void **  result_ptr,
pi_context  context,
pi_device  device,
pi_usm_mem_properties properties,
size_t  size,
pi_uint32  alignment 
)

USM: Implements USM device allocations using a normal HIP device pointer.

Definition at line 4579 of file pi_hip.cpp.

References PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piextUSMEnqueueMemAdvise()

pi_result hip_piextUSMEnqueueMemAdvise ( pi_queue  queue,
const void *  ptr,
size_t  length,
pi_mem_advice  advice,
pi_event event 
)

USM: memadvise API to govern behavior of automatic migration mechanisms.

Definition at line 4766 of file pi_hip.cpp.

References hip_piEnqueueEventsWait(), cl::sycl::length(), and PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piextUSMEnqueueMemcpy()

pi_result hip_piextUSMEnqueueMemcpy ( pi_queue  queue,
pi_bool  blocking,
void *  dst_ptr,
const void *  src_ptr,
size_t  size,
pi_uint32  num_events_in_waitlist,
const pi_event events_waitlist,
pi_event event 
)

◆ hip_piextUSMEnqueueMemset()

pi_result hip_piextUSMEnqueueMemset ( pi_queue  queue,
void *  ptr,
pi_int32  value,
size_t  count,
pi_uint32  num_events_in_waitlist,
const pi_event events_waitlist,
pi_event event 
)

◆ hip_piextUSMEnqueuePrefetch()

pi_result hip_piextUSMEnqueuePrefetch ( pi_queue  queue,
const void *  ptr,
size_t  size,
pi_usm_migration_flags  flags,
pi_uint32  num_events_in_waitlist,
const pi_event events_waitlist,
pi_event event 
)

◆ hip_piextUSMFree()

pi_result hip_piextUSMFree ( pi_context  context,
void *  ptr 
)

USM: Frees the given USM pointer associated with the context.

Definition at line 4628 of file pi_hip.cpp.

References PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piextUSMGetMemAllocInfo()

pi_result hip_piextUSMGetMemAllocInfo ( pi_context  context,
const void *  ptr,
pi_mem_alloc_info  param_name,
size_t  param_value_size,
void *  param_value,
size_t *  param_value_size_ret 
)

API to query information about USM allocated pointers Valid Queries: PI_MEM_ALLOC_TYPE returns host/device/shared pi_host_usm value PI_MEM_ALLOC_BASE_PTR returns the base ptr of an allocation if the queried pointer fell inside an allocation.

Result must fit in void * PI_MEM_ALLOC_SIZE returns how big the queried pointer's allocation is in bytes. Result is a size_t. PI_MEM_ALLOC_DEVICE returns the pi_device this was allocated against

Parameters
contextis the pi_context
ptris the pointer to query
param_nameis the type of query to perform
param_value_sizeis the size of the result in bytes
param_valueis the result
param_value_retis how many bytes were written

Definition at line 4797 of file pi_hip.cpp.

References hip_piPlatformsGet(), PI_INVALID_VALUE, PI_MEM_ALLOC_BASE_PTR, PI_MEM_ALLOC_DEVICE, PI_MEM_ALLOC_SIZE, PI_MEM_ALLOC_TYPE, PI_MEM_TYPE_DEVICE, PI_MEM_TYPE_HOST, PI_MEM_TYPE_SHARED, PI_MEM_TYPE_UNKNOWN, and PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piextUSMHostAlloc()

pi_result hip_piextUSMHostAlloc ( void **  result_ptr,
pi_context  context,
pi_usm_mem_properties properties,
size_t  size,
pi_uint32  alignment 
)

USM: Implements USM Host allocations using HIP Pinned Memory.

Definition at line 4557 of file pi_hip.cpp.

References PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piextUSMSharedAlloc()

pi_result hip_piextUSMSharedAlloc ( void **  result_ptr,
pi_context  context,
pi_device  device,
pi_usm_mem_properties properties,
size_t  size,
pi_uint32  alignment 
)

USM: Implements USM Shared allocations using HIP Managed Memory.

Definition at line 4603 of file pi_hip.cpp.

References PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piKernelCreate()

pi_result hip_piKernelCreate ( pi_program  program,
const char kernel_name,
pi_kernel kernel 
)

Definition at line 2454 of file pi_hip.cpp.

References _pi_program::get(), _pi_program::get_context(), PI_OUT_OF_HOST_MEMORY, and PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piKernelGetGroupInfo()

◆ hip_piKernelGetInfo()

pi_result hip_piKernelGetInfo ( pi_kernel  kernel,
pi_kernel_info  param_name,
size_t  param_value_size,
void *  param_value,
size_t *  param_value_size_ret 
)

◆ hip_piKernelGetSubGroupInfo()

pi_result hip_piKernelGetSubGroupInfo ( pi_kernel  kernel,
pi_device  device,
pi_kernel_sub_group_info  param_name,
size_t  input_value_size,
const void *  input_value,
size_t  param_value_size,
void *  param_value,
size_t *  param_value_size_ret 
)

◆ hip_piKernelRelease()

pi_result hip_piKernelRelease ( pi_kernel  kernel)

Definition at line 3349 of file pi_hip.cpp.

References PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piKernelRetain()

pi_result hip_piKernelRetain ( pi_kernel  kernel)

Definition at line 3341 of file pi_hip.cpp.

References PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piKernelSetArg()

pi_result hip_piKernelSetArg ( pi_kernel  kernel,
pi_uint32  arg_index,
size_t  arg_size,
const void *  arg_value 
)

Definition at line 2494 of file pi_hip.cpp.

References PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piKernelSetExecInfo()

pi_result hip_piKernelSetExecInfo ( pi_kernel  kernel,
pi_kernel_exec_info  param_name,
size_t  param_value_size,
const void *  param_value 
)

Definition at line 3368 of file pi_hip.cpp.

References PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piMemBufferCreate()

pi_result hip_piMemBufferCreate ( pi_context  context,
pi_mem_flags  flags,
size_t  size,
void *  host_ptr,
pi_mem ret_mem,
const pi_mem_properties properties 
)

Creates a PI Memory object using a HIP memory allocation.

Can trigger a manual copy depending on the mode. \TODO Implement USE_HOST_PTR using cuHostRegister

Definition at line 1897 of file pi_hip.cpp.

References _pi_mem::mem_::buffer_mem_::alloc_host_ptr, _pi_mem::mem_::buffer_mem_::classic, _pi_mem::mem_::buffer_mem_::copy_in, PI_MEM_FLAGS_HOST_PTR_ALLOC, PI_MEM_FLAGS_HOST_PTR_COPY, PI_MEM_FLAGS_HOST_PTR_USE, PI_OUT_OF_HOST_MEMORY, PI_OUT_OF_RESOURCES, PI_SUCCESS, and _pi_mem::mem_::buffer_mem_::use_host_ptr.

Referenced by piPluginInit().

◆ hip_piMemBufferPartition()

pi_result hip_piMemBufferPartition ( pi_mem  parent_buffer,
pi_mem_flags  flags,
pi_buffer_create_type  buffer_create_type,
void *  buffer_create_info,
pi_mem memObj 
)

◆ hip_piMemGetInfo()

pi_result hip_piMemGetInfo ( pi_mem  memObj,
pi_mem_info  queriedInfo,
size_t  expectedQuerySize,
void *  queryOutput,
size_t *  writtenQuerySize 
)

Definition at line 2105 of file pi_hip.cpp.

References cl::sycl::detail::pi::die().

Referenced by piPluginInit().

◆ hip_piMemImageCreate()

◆ hip_piMemImageGetInfo()

pi_result hip_piMemImageGetInfo ( pi_mem  image,
pi_image_info  param_name,
size_t  param_value_size,
void *  param_value,
size_t *  param_value_size_ret 
)

\TODO Not implemented

Definition at line 2868 of file pi_hip.cpp.

References cl::sycl::detail::pi::die().

Referenced by piPluginInit().

◆ hip_piMemRelease()

pi_result hip_piMemRelease ( pi_mem  memObj)

◆ hip_piMemRetain()

pi_result hip_piMemRetain ( pi_mem  mem)

◆ hip_piPlatformGetInfo()

pi_result hip_piPlatformGetInfo ( pi_platform  platform,
pi_platform_info  param_name,
size_t  param_value_size,
void *  param_value,
size_t *  param_value_size_ret 
)

◆ hip_piPlatformsGet()

pi_result hip_piPlatformsGet ( pi_uint32  num_entries,
pi_platform platforms,
pi_uint32 num_platforms 
)

Obtains the HIP platform.

There is only one HIP platform, and contains all devices on the system. Triggers the HIP Driver initialization (hipInit) the first time, so this must be the first PI API called.

However because multiple devices in a context is not currently supported, place each device in a separate platform.

Definition at line 700 of file pi_hip.cpp.

References PI_INVALID_VALUE, PI_OUT_OF_HOST_MEMORY, PI_OUT_OF_RESOURCES, and PI_SUCCESS.

Referenced by hip_piextUSMGetMemAllocInfo(), and piPluginInit().

◆ hip_piProgramBuild()

pi_result hip_piProgramBuild ( pi_program  program,
pi_uint32  num_devices,
const pi_device device_list,
const char options,
void(*)(pi_program program, void *user_data)  pfn_notify,
void *  user_data 
)

Loads the images from a PI program into a HIPmodule that can be used later on to extract functions (kernels).

See _pi_program for implementation details.

Definition at line 2910 of file pi_hip.cpp.

References _pi_program::build_program(), _pi_program::get_context(), and PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piProgramCompile()

pi_result hip_piProgramCompile ( pi_program  program,
pi_uint32  num_devices,
const pi_device device_list,
const char options,
pi_uint32  num_input_headers,
const pi_program input_headers,
const char **  header_include_names,
void(*)(pi_program program, void *user_data)  pfn_notify,
void *  user_data 
)

Creates a new program that is the outcome of the compilation of the headers and the program.

\TODO Implement asynchronous compilation

Definition at line 3053 of file pi_hip.cpp.

References _pi_program::build_program(), _pi_program::get_context(), and PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piProgramCreate()

pi_result hip_piProgramCreate ( pi_context  context,
const void *  il,
size_t  length,
pi_program res_program 
)

\TODO Not implemented

Definition at line 2935 of file pi_hip.cpp.

References cl::sycl::detail::pi::die(), and cl::sycl::length().

Referenced by piPluginInit().

◆ hip_piProgramCreateWithBinary()

pi_result hip_piProgramCreateWithBinary ( pi_context  context,
pi_uint32  num_devices,
const pi_device device_list,
const size_t *  lengths,
const unsigned char **  binaries,
size_t  num_metadata_entries,
const pi_device_binary_property metadata,
pi_int32 binary_status,
pi_program program 
)

Loads images from a list of PTX or HIPBIN binaries.

Note: No calls to HIP driver API in this function, only store binaries for later.

Note: Only supports one device

Definition at line 2952 of file pi_hip.cpp.

References _pi_device::get(), cl::sycl::length(), and PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piProgramGetBuildInfo()

pi_result hip_piProgramGetBuildInfo ( pi_program  program,
pi_device  device,
cl_program_build_info  param_name,
size_t  param_value_size,
void *  param_value,
size_t *  param_value_size_ret 
)

◆ hip_piProgramGetInfo()

◆ hip_piProgramLink()

pi_result hip_piProgramLink ( pi_context  context,
pi_uint32  num_devices,
const pi_device device_list,
const char options,
pi_uint32  num_input_programs,
const pi_program input_programs,
void(*)(pi_program program, void *user_data)  pfn_notify,
void *  user_data,
pi_program ret_program 
)

Definition at line 3028 of file pi_hip.cpp.

References cl::sycl::detail::pi::die().

Referenced by piPluginInit().

◆ hip_piProgramRelease()

pi_result hip_piProgramRelease ( pi_program  program)

Decreases the reference count of a pi_program object.

When the reference count reaches 0, it unloads the module from the context.

Definition at line 3116 of file pi_hip.cpp.

References _pi_program::decrement_reference_count(), _pi_program::get(), _pi_program::get_context(), _pi_program::get_reference_count(), PI_INVALID_PROGRAM, PI_OUT_OF_RESOURCES, and PI_SUCCESS.

Referenced by piPluginInit(), and _pi_kernel::~_pi_kernel().

◆ hip_piProgramRetain()

pi_result hip_piProgramRetain ( pi_program  program)

◆ hip_piQueueCreate()

pi_result hip_piQueueCreate ( pi_context  context,
pi_device  device,
pi_queue_properties  properties,
pi_queue queue 
)

Creates a pi_queue object on the HIP backend.

Valid properties

  • __SYCL_PI_HIP_USE_DEFAULT_STREAM -> hipStreamDefault
  • __SYCL_PI_HIP_SYNC_WITH_DEFAULT -> hipStreamNonBlocking
    Returns
    Pi queue object mapping to a HIPStream

Definition at line 2161 of file pi_hip.cpp.

References PI_INVALID_DEVICE, PI_OUT_OF_RESOURCES, and PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piQueueFinish()

pi_result hip_piQueueFinish ( pi_queue  command_queue)

◆ hip_piQueueFlush()

pi_result hip_piQueueFlush ( pi_queue  command_queue)

Definition at line 2282 of file pi_hip.cpp.

References PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piQueueGetInfo()

pi_result hip_piQueueGetInfo ( pi_queue  command_queue,
pi_queue_info  param_name,
size_t  param_value_size,
void *  param_value,
size_t *  param_value_size_ret 
)

◆ hip_piQueueRelease()

pi_result hip_piQueueRelease ( pi_queue  command_queue)

◆ hip_piQueueRetain()

pi_result hip_piQueueRetain ( pi_queue  command_queue)

◆ hip_piSamplerCreate()

pi_result hip_piSamplerCreate ( pi_context  context,
const pi_sampler_properties sampler_properties,
pi_sampler result_sampler 
)

Creates a PI sampler object.

Parameters
[in]contextThe context the sampler is created for.
[in]sampler_propertiesThe properties for the sampler.
[out]result_samplerSet to the resulting sampler object.
Returns
PI_SUCCESS on success. PI_INVALID_VALUE if given an invalid property or if there is multiple of properties from the same category.

Definition at line 3622 of file pi_hip.cpp.

References PI_INVALID_VALUE, PI_SAMPLER_ADDRESSING_MODE_NONE, PI_SAMPLER_FILTER_MODE_NEAREST, PI_SAMPLER_PROPERTIES_ADDRESSING_MODE, PI_SAMPLER_PROPERTIES_FILTER_MODE, PI_SAMPLER_PROPERTIES_NORMALIZED_COORDS, and PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piSamplerGetInfo()

pi_result hip_piSamplerGetInfo ( pi_sampler  sampler,
cl_sampler_info  param_name,
size_t  param_value_size,
void *  param_value,
size_t *  param_value_size_ret 
)

Gets information from a PI sampler object.

Parameters
[in]samplerThe sampler to get the information from.
[in]param_nameThe name of the information to get.
[in]param_value_sizeThe size of the param_value.
[out]param_valueSet to information value.
[out]param_value_size_retSet to the size of the information value.
Returns
PI_SUCCESS on success.

Definition at line 3679 of file pi_hip.cpp.

References __SYCL_PI_HANDLE_UNKNOWN_PARAM_NAME, _pi_sampler::context_, _pi_sampler::get_reference_count(), PI_SAMPLER_ADDRESSING_MODE_NONE, PI_SAMPLER_FILTER_MODE_NEAREST, PI_SAMPLER_INFO_ADDRESSING_MODE, PI_SAMPLER_INFO_CONTEXT, PI_SAMPLER_INFO_FILTER_MODE, PI_SAMPLER_INFO_NORMALIZED_COORDS, PI_SAMPLER_INFO_REFERENCE_COUNT, and _pi_sampler::props_.

Referenced by piPluginInit().

◆ hip_piSamplerRelease()

pi_result hip_piSamplerRelease ( pi_sampler  sampler)

Releases a PI sampler object, decrementing its reference count.

If the reference count reaches zero, the sampler object is destroyed.

Parameters
[in]samplerThe sampler to decrement the reference count of.
Returns
PI_SUCCESS.

Definition at line 3732 of file pi_hip.cpp.

References cl::sycl::detail::pi::assertion(), _pi_sampler::decrement_reference_count(), _pi_sampler::get_reference_count(), and PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piSamplerRetain()

pi_result hip_piSamplerRetain ( pi_sampler  sampler)

Retains a PI sampler object, incrementing its reference count.

Parameters
[in]samplerThe sampler to increment the reference count of.
Returns
PI_SUCCESS.

Definition at line 3720 of file pi_hip.cpp.

References _pi_sampler::increment_reference_count(), and PI_SUCCESS.

Referenced by piPluginInit().

◆ hip_piTearDown()

pi_result hip_piTearDown ( void *  PluginParameter)

Definition at line 4881 of file pi_hip.cpp.

References PI_SUCCESS.

Referenced by piPluginInit().

◆ imageElementByteSize()

static size_t imageElementByteSize ( hipArray_Format  array_format)
static

◆ piPluginInit()

pi_result piPluginInit ( pi_plugin PluginInit)

Definition at line 4888 of file pi_hip.cpp.

References _PI_CL, hip_piclProgramCreateWithSource(), hip_piContextCreate(), hip_piContextGetInfo(), hip_piContextRelease(), hip_piContextRetain(), hip_piDeviceGetInfo(), hip_piDevicePartition(), hip_piDeviceRelease(), hip_piDeviceRetain(), hip_piDevicesGet(), hip_piEnqueueEventsWait(), hip_piEnqueueEventsWaitWithBarrier(), hip_piEnqueueKernelLaunch(), hip_piEnqueueMemBufferCopy(), hip_piEnqueueMemBufferCopyRect(), hip_piEnqueueMemBufferFill(), hip_piEnqueueMemBufferMap(), hip_piEnqueueMemBufferRead(), hip_piEnqueueMemBufferReadRect(), hip_piEnqueueMemBufferWrite(), hip_piEnqueueMemBufferWriteRect(), hip_piEnqueueMemImageCopy(), hip_piEnqueueMemImageFill(), hip_piEnqueueMemImageRead(), hip_piEnqueueMemImageWrite(), hip_piEnqueueMemUnmap(), hip_piEnqueueNativeKernel(), hip_piEventCreate(), hip_piEventGetInfo(), hip_piEventGetProfilingInfo(), hip_piEventRelease(), hip_piEventRetain(), hip_piEventSetCallback(), hip_piEventSetStatus(), hip_piEventsWait(), hip_piextContextCreateWithNativeHandle(), hip_piextContextGetNativeHandle(), hip_piextContextSetExtendedDeleter(), hip_piextDeviceCreateWithNativeHandle(), hip_piextDeviceGetNativeHandle(), hip_piextDeviceSelectBinary(), hip_piextEventCreateWithNativeHandle(), hip_piextEventGetNativeHandle(), hip_piextGetDeviceFunctionPointer(), hip_piextKernelSetArgMemObj(), hip_piextKernelSetArgPointer(), hip_piextKernelSetArgSampler(), hip_piextMemCreateWithNativeHandle(), hip_piextMemGetNativeHandle(), hip_piextProgramCreateWithNativeHandle(), hip_piextProgramGetNativeHandle(), hip_piextProgramSetSpecializationConstant(), hip_piextQueueCreateWithNativeHandle(), hip_piextQueueGetNativeHandle(), hip_piextUSMDeviceAlloc(), hip_piextUSMEnqueueMemAdvise(), hip_piextUSMEnqueueMemcpy(), hip_piextUSMEnqueueMemset(), hip_piextUSMEnqueuePrefetch(), hip_piextUSMFree(), hip_piextUSMGetMemAllocInfo(), hip_piextUSMHostAlloc(), hip_piextUSMSharedAlloc(), hip_piKernelCreate(), hip_piKernelGetGroupInfo(), hip_piKernelGetInfo(), hip_piKernelGetSubGroupInfo(), hip_piKernelRelease(), hip_piKernelRetain(), hip_piKernelSetArg(), hip_piKernelSetExecInfo(), hip_piMemBufferCreate(), hip_piMemBufferPartition(), hip_piMemGetInfo(), hip_piMemImageCreate(), hip_piMemImageGetInfo(), hip_piMemRelease(), hip_piMemRetain(), hip_piPlatformGetInfo(), hip_piPlatformsGet(), hip_piProgramBuild(), hip_piProgramCompile(), hip_piProgramCreate(), hip_piProgramCreateWithBinary(), hip_piProgramGetBuildInfo(), hip_piProgramGetInfo(), hip_piProgramLink(), hip_piProgramRelease(), hip_piProgramRetain(), hip_piQueueCreate(), hip_piQueueFinish(), hip_piQueueFlush(), hip_piQueueGetInfo(), hip_piQueueRelease(), hip_piQueueRetain(), hip_piSamplerCreate(), hip_piSamplerGetInfo(), hip_piSamplerRelease(), hip_piSamplerRetain(), hip_piTearDown(), PI_INVALID_OPERATION, PI_INVALID_VALUE, PI_SUCCESS, piclProgramCreateWithSource(), piContextCreate(), piContextGetInfo(), piContextRelease(), piContextRetain(), piDeviceGetInfo(), piDevicePartition(), piDeviceRelease(), piDeviceRetain(), piDevicesGet(), piEnqueueEventsWait(), piEnqueueEventsWaitWithBarrier(), piEnqueueKernelLaunch(), piEnqueueMemBufferCopy(), piEnqueueMemBufferCopyRect(), piEnqueueMemBufferFill(), piEnqueueMemBufferMap(), piEnqueueMemBufferRead(), piEnqueueMemBufferReadRect(), piEnqueueMemBufferWrite(), piEnqueueMemBufferWriteRect(), piEnqueueMemImageCopy(), piEnqueueMemImageFill(), piEnqueueMemImageRead(), piEnqueueMemImageWrite(), piEnqueueMemUnmap(), piEnqueueNativeKernel(), piEventCreate, piEventGetInfo(), piEventGetProfilingInfo(), piEventRelease(), piEventRetain(), piEventSetCallback(), piEventSetStatus(), piEventsWait(), piextContextCreateWithNativeHandle(), piextContextGetNativeHandle(), piextContextSetExtendedDeleter(), piextDeviceCreateWithNativeHandle(), piextDeviceGetNativeHandle(), piextDeviceSelectBinary(), piextEventCreateWithNativeHandle(), piextEventGetNativeHandle(), piextGetDeviceFunctionPointer(), piextKernelSetArgMemObj(), piextKernelSetArgPointer(), piextKernelSetArgSampler(), piextMemCreateWithNativeHandle(), piextMemGetNativeHandle(), piextProgramCreateWithNativeHandle(), piextProgramGetNativeHandle(), piextProgramSetSpecializationConstant(), piextQueueCreateWithNativeHandle(), piextQueueGetNativeHandle(), piextUSMDeviceAlloc(), piextUSMEnqueueMemAdvise(), piextUSMEnqueueMemcpy(), piextUSMEnqueueMemset(), piextUSMEnqueuePrefetch(), piextUSMFree(), piextUSMGetMemAllocInfo(), piextUSMHostAlloc(), piextUSMSharedAlloc(), _pi_plugin::PiFunctionTable, piKernelCreate(), piKernelGetGroupInfo(), piKernelGetInfo(), piKernelGetSubGroupInfo(), piKernelRelease(), piKernelRetain(), piKernelSetArg(), piKernelSetExecInfo(), piMemBufferCreate(), piMemBufferPartition(), piMemGetInfo(), piMemImageCreate(), piMemImageGetInfo(), piMemRelease(), piMemRetain(), piPlatformGetInfo(), piPlatformsGet(), piPluginGetLastError(), piProgramBuild(), piProgramCompile(), piProgramCreate(), piProgramCreateWithBinary(), piProgramGetBuildInfo(), piProgramGetInfo(), piProgramLink(), piProgramRelease(), piProgramRetain(), piQueueCreate(), piQueueFinish(), piQueueFlush(), piQueueGetInfo(), piQueueRelease(), piQueueRetain(), piSamplerCreate(), piSamplerGetInfo(), piSamplerRelease(), piSamplerRetain(), piTearDown(), _pi_plugin::PiVersion, _pi_plugin::PluginVersion, and SupportedVersion.

Variable Documentation

◆ SupportedVersion

const char SupportedVersion[] = _PI_H_VERSION_STRING

Definition at line 4886 of file pi_hip.cpp.

Referenced by piPluginInit().