Skip to content

Commit e6765c9

Browse files
authored
Merge pull request #236 from IntelPython/master
0.5.1rc1
2 parents f4a281f + 629d13a commit e6765c9

File tree

11 files changed

+431
-96
lines changed

11 files changed

+431
-96
lines changed

docs/dpCtl.dptensor_api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ dpCtl dptensor Python API
66

77
.. automodule:: dpctl.dptensor
88
:members:
9+
:undoc-members:

docs/dpCtl.memory_api.rst

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,27 @@ dpCtl Memory Python API
55
#######################
66

77
.. automodule:: dpctl.memory
8+
9+
Classes
10+
-------
11+
12+
.. autoclass:: dpctl.memory.MemoryUSMDevice
813
:members:
14+
:inherited-members:
15+
:undoc-members:
916

10-
....
17+
.. autoclass:: dpctl.memory.MemoryUSMHost
18+
:members:
19+
:inherited-members:
20+
:undoc-members:
21+
22+
.. autoclass:: dpctl.memory.MemoryUSMShared
23+
:members:
24+
:inherited-members:
25+
:undoc-members:
1126

12-
**Comparing dpctl.memory to Rapids Memory Manager (RMM)**
27+
Comparison with Rapids Memory Manager (RMM)
28+
-------------------------------------------
1329

1430
RMM implements DeviceBuffer which is Cython native class wrapping around something similar to ``std::vector<unsigned char, custom_cuda_allocator (calls resource manager)>`` which is called device_buffer.
1531

docs/dpCtl.program_api.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,25 @@ dpCtl Program Python API
55
########################
66

77
.. automodule:: dpctl.program
8+
9+
Classes
10+
-------
11+
12+
.. autoclass:: dpctl.program.SyclKernel
13+
:members:
14+
:undoc-members:
15+
16+
.. autoclass:: dpctl.program.SyclProgram
817
:members:
18+
:undoc-members:
19+
20+
Exceptions
21+
----------
22+
23+
.. autoexception:: dpctl.program.SyclProgramCompilationError
24+
25+
Functions
26+
---------
27+
28+
.. autofunction:: create_program_from_source
29+
.. autofunction:: create_program_from_spirv

docs/dpCtl_api.rst

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,58 @@ dpCtl Python API
55
################
66

77
.. automodule:: dpctl
8-
:members:
8+
9+
Classes
10+
-------
11+
12+
.. autoclass:: dpctl.SyclContext
13+
:members:
14+
:undoc-members:
15+
16+
.. autoclass:: dpctl.SyclDevice
17+
:members:
18+
:undoc-members:
19+
20+
.. autoclass:: dpctl.SyclEvent
21+
:members:
22+
:undoc-members:
23+
24+
.. autoclass:: dpctl.SyclQueue
25+
:members:
26+
:undoc-members:
27+
28+
Enumerations
29+
------------
30+
31+
.. autoclass:: dpctl.backend_type
32+
:members:
33+
34+
.. autoclass:: dpctl.device_type
35+
:members:
36+
37+
Exceptions
38+
----------
39+
40+
.. autoexception:: dpctl.SyclKernelInvalidRangeError
41+
.. autoexception:: dpctl.SyclKernelSubmitError
42+
.. autoexception:: dpctl.SyclQueueCreationError
43+
.. autoexception:: dpctl.UnsupportedBackendError
44+
.. autoexception:: dpctl.UnsupportedDeviceError
45+
46+
Functions
47+
---------
48+
49+
.. autofunction:: device_context
50+
.. autofunction:: dump
51+
.. autofunction:: get_current_backend
52+
.. autofunction:: get_current_device_type
53+
.. autofunction:: get_current_queue
54+
.. autofunction:: get_include
55+
.. autofunction:: get_num_activated_queues
56+
.. autofunction:: get_num_platforms
57+
.. autofunction:: get_num_queues
58+
.. autofunction:: has_cpu_queues
59+
.. autofunction:: has_gpu_queues
60+
.. autofunction:: has_sycl_platforms
61+
.. autofunction:: is_in_device_context
62+
.. autofunction:: set_default_queue

docs/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,5 @@ Indices and tables
2222
:maxdepth: 3
2323
:caption: Contents:
2424

25-
self
2625
toc_pyapi
2726
api/dpCtl-CAPI_root

docs/toc_pyapi.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ Python API
55
:maxdepth: 1
66

77
dpctl - SYCL runtime wrapper classes and queue manager <dpCtl_api>
8-
dpctl.memory - USM memory manager <dpCtl.memory_api>
98
dpctl.dptensor - Data-parallel tensor containers <dpCtl.dptensor_api>
9+
dpctl.memory - USM memory manager <dpCtl.memory_api>
1010
dpctl.program - Program manager <dpCtl.program_api>

dpctl-capi/source/dpctl_sycl_queue_manager.cpp

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ QMgrHelper::getQueue (DPCTLSyclBackendType BETy,
236236
QRef = new queue(gpuQs[DNum]);
237237
break;
238238
}
239-
case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO | DPCTLSyclDeviceType::DPCTL_GPU:
239+
case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO |
240+
DPCTLSyclDeviceType::DPCTL_GPU:
240241
{
241242
auto l0GpuQs = get_level0_gpu_queues();
242243
if (DNum >= l0GpuQs.size()) {
@@ -316,7 +317,8 @@ QMgrHelper::setAsDefaultQueue (DPCTLSyclBackendType BETy,
316317
activeQ[0] = oclgpu_q[DNum];
317318
break;
318319
}
319-
case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO | DPCTLSyclDeviceType::DPCTL_GPU:
320+
case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO |
321+
DPCTLSyclDeviceType::DPCTL_GPU:
320322
{
321323
auto l0gpu_q = get_level0_gpu_queues();
322324
if (DNum >= l0gpu_q.size()) {
@@ -342,8 +344,8 @@ QMgrHelper::setAsDefaultQueue (DPCTLSyclBackendType BETy,
342344
/*!
343345
* Allocates a new sycl::queue by copying from the cached {cpu|gpu}_queues
344346
* vector. The pointer returned is now owned by the caller and must be properly
345-
* cleaned up. The helper function DPCTLDeleteSyclQueue() can be used is for that
346-
* purpose.
347+
* cleaned up. The helper function DPCTLDeleteSyclQueue() can be used is for
348+
* that purpose.
347349
*/
348350
__dpctl_give DPCTLSyclQueueRef
349351
QMgrHelper::pushSyclQueue (DPCTLSyclBackendType BETy,
@@ -383,7 +385,8 @@ QMgrHelper::pushSyclQueue (DPCTLSyclBackendType BETy,
383385
QRef = new queue(activeQ[get_active_queues().size()-1]);
384386
break;
385387
}
386-
case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO | DPCTLSyclDeviceType::DPCTL_GPU:
388+
case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO |
389+
DPCTLSyclDeviceType::DPCTL_GPU:
387390
{
388391
if (DNum >= get_level0_gpu_queues().size()) {
389392
// \todo handle error
@@ -447,7 +450,7 @@ size_t DPCTLQueueMgr_GetNumActivatedQueues ()
447450
* type combination.
448451
*/
449452
size_t DPCTLQueueMgr_GetNumQueues (DPCTLSyclBackendType BETy,
450-
DPCTLSyclDeviceType DeviceTy)
453+
DPCTLSyclDeviceType DeviceTy)
451454
{
452455
switch (BETy|DeviceTy)
453456
{
@@ -459,7 +462,8 @@ size_t DPCTLQueueMgr_GetNumQueues (DPCTLSyclBackendType BETy,
459462
{
460463
return QMgrHelper::get_opencl_gpu_queues().size();
461464
}
462-
case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO | DPCTLSyclDeviceType::DPCTL_GPU:
465+
case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO |
466+
DPCTLSyclDeviceType::DPCTL_GPU:
463467
{
464468
return QMgrHelper::get_level0_gpu_queues().size();
465469
}
@@ -485,8 +489,8 @@ DPCTLSyclQueueRef DPCTLQueueMgr_GetCurrentQueue ()
485489
* and device number. A runtime_error gets thrown if no such device exists.
486490
*/
487491
DPCTLSyclQueueRef DPCTLQueueMgr_GetQueue (DPCTLSyclBackendType BETy,
488-
DPCTLSyclDeviceType DeviceTy,
489-
size_t DNum)
492+
DPCTLSyclDeviceType DeviceTy,
493+
size_t DNum)
490494
{
491495
return QMgrHelper::getQueue(BETy, DeviceTy, DNum);
492496
}
@@ -506,8 +510,8 @@ bool DPCTLQueueMgr_IsCurrentQueue (__dpctl_keep const DPCTLSyclQueueRef QRef)
506510
*/
507511
__dpctl_give DPCTLSyclQueueRef
508512
DPCTLQueueMgr_SetAsDefaultQueue (DPCTLSyclBackendType BETy,
509-
DPCTLSyclDeviceType DeviceTy,
510-
size_t DNum)
513+
DPCTLSyclDeviceType DeviceTy,
514+
size_t DNum)
511515
{
512516
return QMgrHelper::setAsDefaultQueue(BETy, DeviceTy, DNum);
513517
}
@@ -517,8 +521,8 @@ DPCTLQueueMgr_SetAsDefaultQueue (DPCTLSyclBackendType BETy,
517521
*/
518522
__dpctl_give DPCTLSyclQueueRef
519523
DPCTLQueueMgr_PushQueue (DPCTLSyclBackendType BETy,
520-
DPCTLSyclDeviceType DeviceTy,
521-
size_t DNum)
524+
DPCTLSyclDeviceType DeviceTy,
525+
size_t DNum)
522526
{
523527
return QMgrHelper::pushSyclQueue(BETy, DeviceTy, DNum);
524528
}
@@ -536,8 +540,10 @@ void DPCTLQueueMgr_PopQueue ()
536540
* SYCL device.
537541
*/
538542
DPCTLSyclQueueRef
539-
DPCTLQueueMgr_GetQueueFromContextAndDevice (__dpctl_keep DPCTLSyclContextRef CRef,
540-
__dpctl_keep DPCTLSyclDeviceRef DRef)
543+
DPCTLQueueMgr_GetQueueFromContextAndDevice (
544+
__dpctl_keep DPCTLSyclContextRef CRef,
545+
__dpctl_keep DPCTLSyclDeviceRef DRef
546+
)
541547
{
542548
auto dev = unwrap(DRef);
543549
auto ctx = unwrap(CRef);

dpctl/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@
3030
3131
* A SYCL queue manager exposed directly inside the top-level `dpctl`
3232
module.
33-
* A USM memory manager (`dpctl.memory`) that provides Python objects
34-
implementing the Python buffer protocol using USM shared and USM host
35-
allocators. The memory manager also exposes various utility functions
36-
to wrap SYCL's USM allocators, deallocators, `memcpy` functions, *etc.*
33+
* Python wrapper classes for the main SYCL runtime classes mentioned in
34+
Section 4.6 of SYCL provisional 2020 spec (https://bit.ly/3asQx07).
3735
"""
3836
__author__ = "Intel Corp."
3937

0 commit comments

Comments
 (0)