Skip to content

Segfault in creating sub-devices #475

Closed
@diptorupd

Description

@diptorupd

Passing an incorrect argument for count to create_sub_devices can lead to a segfault. The issue is that SYCL expects an unsigned long as the count and passing a zero as done in the below reproducer. We are missing an exception check in C API.

In [1]: import dpctl

In [2]:                 cpu_d = dpctl.SyclDevice("cpu")
   ...:                 cpu_count = cpu_d.max_compute_units
   ...:                 sub_devs = cpu_d.create_sub_devices(partition=cpu_count // 100)
   ...:                 for d in sub_devs:
   ...:                     d.print_device_info()

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions