Skip to content

Conversation

@diptorupd
Copy link
Contributor

Cleaned up version of #343

PokhodenkoSA and others added 30 commits April 1, 2021 18:42
* We need at least CMake 3.15 for dpctl-capi. (#299)
  * Do not use POP_FRONT in FindDPCPP.cmake so that we can use a cmake version older that 3.15.
* Run GitHub Actions for all PRs
* Update CHANGELOG
  - Add a new dpctl_sycl_device_manager module to store a
    cache of root devices along with a cached context per
    device.
  - The device manager includes functions to get a vector of
    devices and the number of root devices of a specific type
    and backend combination.
  - Move the DPCTLDevice_DumpInfo() to a new module called
    dpctl_sycl_device_manager, and rename it to
    DPCTLDeviceMgr_PrintDeviceInfo().
  - Introduce a new _sycl_device_factory module in the Python API.
  - Move device selector functions to the _sycl_device_factory
    module.
  - Add functions to get list of SYCL devies in dpctl.
* Add support of Current DPCPP aspects to dpctl.
* All aspects are now available in the C API using the `DPCTLDevice_HasAspect` function.
* Previous C API functions to get atomics aspects are now removed.
* Add utilities functions to convert SYCL aspects to dpctl aspect types and vice-versa
* Add a utility function to convert aspects to string.

Co-authored-by: etotmeni <[email protected]>
…use them in tests intsead of has_cpu_queue,etc. (#320)

Co-authored-by: Oleksandr Pavlyk <[email protected]>
This way _SyclDevice, which can be create with data attributes default
using _SyclDevice() can not be used (no methods defined).

Modified __repr__ for SyclDevice to reflect backend, device kind and the
the device name as reported by dev.get_info<sycl::info::device::name>().
1. error_handler function typedef changed
2. DPCTLDevice_Copy, DPCTLQueue_Copy added
3. DPCTLDeviceMgr_GetContextAndDevicePair exported as well as
   the struct it returns.
SyclQueue(device_selector, props)
SyclQueue(sycl_device, props)
SyclQueue(sycl_context, sycl_device, props)

create SyclQueue from given data. A default asynch error handler is
used. The error handler raises SyclAsynchronousError.
Removed get_num_queues, has_cpu_queues, has_gpu_queues.

The context manager accepts device selector string, device,
or a queue itself.
oleksandr-pavlyk and others added 26 commits April 1, 2021 18:45
[X] Implementation
[X] Header + Documentation comment
[X] Two tests in test_sycl_context.cpp
[X] Exported in `dpctl/_backend.pxd`
Returns list of SyclDevice objects associated with the given queue.
Added method device_count (perhaps could be a property), and used it to
give different __repr__ outputs for single-device contexts and multi-device
context instances.
When creating from a device, we must look up cached DeviceAndContext
pair first, and only if that fails call DPCTLContext_Create

SyclContext was not doing a look-up, and SyclQueue was not doing the
creation is the lookup were to fail.
Added two more tests to test_sycl_context.py

One of them is skipped due to a bug in DPC++, which is expected to be
fixed in update 2 of oneAPI 2021
Also fixed alignment of colons in the docstring.
Prominently state that _create deletes its argument reference variable.

DPCTL opaque pointers will be consumed by most _init_* functions.

Enabled test which was xfailed waiting for the DPCPP update.
references by opaque pointers in the given array, making these copies
is removed from Cython.
It was placed in the middle of initialization code block, separating
`__cinit__` from `_init_*` routines it uses.
1. create_sub_devices requires use of keyword argument parition.
   Usage is d.create_sub_devices(partition=4)
2. Plugged possible memory leak in create_sub_devices_by_counts
   which memory allocated for array would not be freed if sub-devices
   vector was returned NULL
3. Changed signature of create_sub_device_by_counts from accepting object
   of type list, to accepting any object, which is checked to be Sized
   (len(obj) is expected to work), and Iterable, i.s. iteration of
   elements works
4. Changes to accept all integral types, such as np.int32, not just python int.
5. Got rid of _raise_create_sub_devices_exception function, and replaced
   it with explicit raise CreateSubDevicesError(message)
@diptorupd diptorupd closed this Apr 2, 2021
@diptorupd diptorupd deleted the review-sub-devices_v2 branch April 2, 2021 00:55
@diptorupd diptorupd restored the review-sub-devices_v2 branch April 2, 2021 13:39
@diptorupd diptorupd deleted the review-sub-devices_v2 branch April 2, 2021 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants