DPNP C++ backend kernel library 0.18.0dev0
Data Parallel Extension for NumPy*
Loading...
Searching...
No Matches
Backend C++ library interface API

Functions

size_t dpnp_queue_is_cpu_c ()
 SYCL queue device status.
 
char * dpnp_memory_alloc_c (DPCTLSyclQueueRef q_ref, size_t size_in_bytes)
 SYCL queue memory allocation.
 
template<typename _DataType >
DPCTLSyclEventRef dpnp_partition_c (DPCTLSyclQueueRef q_ref, void *array, void *array2, void *result, const size_t kth, const shape_elem_type *shape, const size_t ndim, const DPCTLEventVectorRef dep_event_vec_ref)
 Return a partitioned copy of an array.
 
template<typename _DataType >
DPCTLSyclEventRef dpnp_initval_c (DPCTLSyclQueueRef q_ref, void *result1, void *value, size_t size, const DPCTLEventVectorRef dep_event_vec_ref)
 implementation of creating filled with value array function
 
template<typename _DataType_input , typename _DataType_output >
DPCTLSyclEventRef dpnp_modf_c (DPCTLSyclQueueRef q_ref, void *array1_in, void *result1_out, void *result2_out, size_t size, const DPCTLEventVectorRef dep_event_vec_ref)
 modf function.
 
template<typename _DataType >
DPCTLSyclEventRef dpnp_ones_c (DPCTLSyclQueueRef q_ref, void *result, size_t size, const DPCTLEventVectorRef dep_event_vec_ref)
 Implementation of ones function.
 
template<typename _DataType >
DPCTLSyclEventRef dpnp_ones_like_c (DPCTLSyclQueueRef q_ref, void *result, size_t size, const DPCTLEventVectorRef dep_event_vec_ref)
 Implementation of ones_like function.
 
template<typename _DataType >
DPCTLSyclEventRef dpnp_zeros_c (DPCTLSyclQueueRef q_ref, void *result, size_t size, const DPCTLEventVectorRef dep_event_vec_ref)
 Implementation of zeros function.
 
template<typename _DataType >
DPCTLSyclEventRef dpnp_zeros_like_c (DPCTLSyclQueueRef q_ref, void *result, size_t size, const DPCTLEventVectorRef dep_event_vec_ref)
 Implementation of zeros_like function.
 
DPNPFuncData_t get_dpnp_function_ptr (DPNPFuncName name, DPNPFuncType first_type, DPNPFuncType second_type=DPNPFuncType::DPNP_FT_NONE)
 get runtime pointer to selected function
 
void * get_dpnp_function_ptr1 (DPNPFuncType &result_type, DPNPFuncName name, DPNPFuncType first_type, DPNPFuncType second_type=DPNPFuncType::DPNP_FT_NONE)
 get runtime pointer to selected function
 
void MT19937_InitScalarSeed (mt19937_struct *mt19937, DPCTLSyclQueueRef q_ref, uint32_t seed=1)
 Create a MKL engine from scalar seed.
 
void MT19937_InitVectorSeed (mt19937_struct *mt19937, DPCTLSyclQueueRef q_ref, uint32_t *seed, unsigned int n)
 Create a MKL engine from seed vector.
 
void MT19937_Delete (mt19937_struct *mt19937)
 Release a MKL engine.
 
void MCG59_InitScalarSeed (mcg59_struct *mcg59, DPCTLSyclQueueRef q_ref, uint64_t seed)
 Create a MKL engine from scalar seed.
 
void MCG59_Delete (mcg59_struct *mcg59)
 Release a MKL engine.
 

Detailed Description

This section describes Backend API.

Function Documentation

◆ dpnp_initval_c()

template<typename _DataType >
DPCTLSyclEventRef dpnp_initval_c ( DPCTLSyclQueueRef q_ref,
void * result1,
void * value,
size_t size,
const DPCTLEventVectorRef dep_event_vec_ref )

implementation of creating filled with value array function

Parameters
[in]q_refReference to SYCL queue.
[out]result1Output array.
[in]valueValue in array.
[in]sizeNumber of elements in array.
[in]dep_event_vec_refReference to vector of SYCL events.

◆ dpnp_memory_alloc_c()

char * dpnp_memory_alloc_c ( DPCTLSyclQueueRef q_ref,
size_t size_in_bytes )

SYCL queue memory allocation.

Memory allocation on the SYCL backend.

Parameters
[in]size_in_bytesNumber of bytes for requested memory allocation.
[in]q_refReference to SYCL queue.
Returns
A pointer to newly created memory on SYCL device.
Here is the caller graph for this function:

◆ dpnp_modf_c()

template<typename _DataType_input , typename _DataType_output >
DPCTLSyclEventRef dpnp_modf_c ( DPCTLSyclQueueRef q_ref,
void * array1_in,
void * result1_out,
void * result2_out,
size_t size,
const DPCTLEventVectorRef dep_event_vec_ref )

modf function.

Parameters
[in]q_refReference to SYCL queue.
[in]array1_inInput array.
[out]result1_outOutput array 1.
[out]result2_outOutput array 2.
[in]sizeNumber of elements in input arrays.
[in]dep_event_vec_refReference to vector of SYCL events.

◆ dpnp_ones_c()

template<typename _DataType >
DPCTLSyclEventRef dpnp_ones_c ( DPCTLSyclQueueRef q_ref,
void * result,
size_t size,
const DPCTLEventVectorRef dep_event_vec_ref )

Implementation of ones function.

Parameters
[in]q_refReference to SYCL queue.
[out]resultOutput array.
[in]sizeNumber of elements in the output array.
[in]dep_event_vec_refReference to vector of SYCL events.

◆ dpnp_ones_like_c()

template<typename _DataType >
DPCTLSyclEventRef dpnp_ones_like_c ( DPCTLSyclQueueRef q_ref,
void * result,
size_t size,
const DPCTLEventVectorRef dep_event_vec_ref )

Implementation of ones_like function.

Parameters
[in]q_refReference to SYCL queue.
[out]resultOutput array.
[in]sizeNumber of elements in the output array.
[in]dep_event_vec_refReference to vector of SYCL events.

◆ dpnp_partition_c()

template<typename _DataType >
DPCTLSyclEventRef dpnp_partition_c ( DPCTLSyclQueueRef q_ref,
void * array,
void * array2,
void * result,
const size_t kth,
const shape_elem_type * shape,
const size_t ndim,
const DPCTLEventVectorRef dep_event_vec_ref )

Return a partitioned copy of an array.

Parameters
[in]q_refReference to SYCL queue.
[in]arrayInput array.
[in]array2Copy input array.
[out]resultResult array.
[in]kthElement index to partition by.
[in]shapeShape of input array.
[in]ndimNumber of elements in shape.
[in]dep_event_vec_refReference to vector of SYCL events.

◆ dpnp_queue_is_cpu_c()

size_t dpnp_queue_is_cpu_c ( )

SYCL queue device status.

Return 1 if current queue is related to cpu device. return 0 otherwise.

◆ dpnp_zeros_c()

template<typename _DataType >
DPCTLSyclEventRef dpnp_zeros_c ( DPCTLSyclQueueRef q_ref,
void * result,
size_t size,
const DPCTLEventVectorRef dep_event_vec_ref )

Implementation of zeros function.

Parameters
[in]q_refReference to SYCL queue.
[out]resultOutput array.
[in]sizeNumber of elements in the output array.
[in]dep_event_vec_refReference to vector of SYCL events.

◆ dpnp_zeros_like_c()

template<typename _DataType >
DPCTLSyclEventRef dpnp_zeros_like_c ( DPCTLSyclQueueRef q_ref,
void * result,
size_t size,
const DPCTLEventVectorRef dep_event_vec_ref )

Implementation of zeros_like function.

Parameters
[in]q_refReference to SYCL queue.
[out]resultOutput array.
[in]sizeNumber of elements in the output array.
[in]dep_event_vec_refReference to vector of SYCL events.

◆ get_dpnp_function_ptr()

DPNPFuncData_t get_dpnp_function_ptr ( DPNPFuncName name,
DPNPFuncType first_type,
DPNPFuncType second_type = DPNPFuncType::DPNP_FT_NONE )

get runtime pointer to selected function

Runtime pointer to the backend API function from storage map<name, map<first_type, map<second_type, DPNPFuncData_t>>>

Parameters
[in]nameName of the function in storage
[in]first_typeFirst type of the storage
[in]second_typeSecond type of the storage
Returns
Struct DPNPFuncData_t with information about the backend API function.

◆ get_dpnp_function_ptr1()

void * get_dpnp_function_ptr1 ( DPNPFuncType & result_type,
DPNPFuncName name,
DPNPFuncType first_type,
DPNPFuncType second_type = DPNPFuncType::DPNP_FT_NONE )

get runtime pointer to selected function

Same interface function as get_dpnp_function_ptr with a bit different interface

Parameters
[out]result_typeType of the result provided by the backend API function
[in]nameName of the function in storage
[in]first_typeFirst type of the storage
[in]second_typeSecond type of the storage
Returns
pointer to the backend API function.

◆ MCG59_Delete()

void MCG59_Delete ( mcg59_struct * mcg59)

Release a MKL engine.

Release all resource required for storing of the MKL engine.

Parameters
[in]mcg59A structure with the MKL engine.

◆ MCG59_InitScalarSeed()

void MCG59_InitScalarSeed ( mcg59_struct * mcg59,
DPCTLSyclQueueRef q_ref,
uint64_t seed )

Create a MKL engine from scalar seed.

Invoke a common seed initialization of the engine for MCG59 algorithm.

Parameters
[in]mcg59A structure with MKL engine which will be filled with generated value by MKL.
[in]q_refA reference on SYCL queue which will be used to obtain random numbers.
[in]seedAn initial condition of the generator state.

◆ MT19937_Delete()

void MT19937_Delete ( mt19937_struct * mt19937)

Release a MKL engine.

Release all resource required for storing of the MKL engine.

Parameters
[in]mt19937A structure with the MKL engine.

◆ MT19937_InitScalarSeed()

void MT19937_InitScalarSeed ( mt19937_struct * mt19937,
DPCTLSyclQueueRef q_ref,
uint32_t seed = 1 )

Create a MKL engine from scalar seed.

Invoke a common seed initialization of the engine for MT199374x32x10 algorithm.

Parameters
[in]mt19937A structure with MKL engine which will be filled with generated value by MKL.
[in]q_refA reference on SYCL queue which will be used to obtain random numbers.
[in]seedAn initial condition of the generator state.

◆ MT19937_InitVectorSeed()

void MT19937_InitVectorSeed ( mt19937_struct * mt19937,
DPCTLSyclQueueRef q_ref,
uint32_t * seed,
unsigned int n )

Create a MKL engine from seed vector.

Invoke an extended seed initialization of the engine for MT199374x32x10 algorithm..

Parameters
[in]mt19937A structure with MKL engine which will be filled with generated value by MKL.
[in]q_refA reference on SYCL queue which will be used to obtain random numbers.
[in]seedA vector with the initial conditions of the generator state.
[in]nLength of the vector.