Skip to content

Commit cdcef0d

Browse files
committed
apply review comments
1 parent ccb8cf7 commit cdcef0d

5 files changed

Lines changed: 23 additions & 16 deletions

File tree

dpctl/_sycl_device.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2879,9 +2879,9 @@ cdef class SyclDevice(_SyclDevice):
28792879
28802880
Parameters:
28812881
language
2882-
Input language. Possible values are "spirv" for SPIR-V binary
2883-
files, "opencl" for OpenCL C device code and "sycl" for SYCL
2884-
device code.
2882+
Input language. Possible values are "spirv" or "spv" for
2883+
SPIR-V binary files, "opencl" or "ocl" for OpenCL C device code
2884+
and "sycl" for SYCL device code.
28852885
28862886
Returns:
28872887
bool:

dpctl/_sycl_queue.pxd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,16 @@ cdef public api class SyclQueue (_SyclQueue) [
6868
cdef int _populate_range(self, size_t Range[3], list gS, size_t nGS)
6969

7070
@staticmethod
71-
cdef SyclQueue _create(DPCTLSyclQueueRef qref)
71+
cdef SyclQueue _create(DPCTLSyclQueueRef qref)
7272

7373
@staticmethod
74-
cdef SyclQueue _create_from_context_and_device(
74+
cdef SyclQueue _create_from_context_and_device(
7575
SyclContext ctx, SyclDevice dev, int props=*
7676
)
7777
cdef cpp_bool equals(self, SyclQueue q)
7878
cpdef SyclContext get_sycl_context(self)
7979
cpdef SyclDevice get_sycl_device(self)
80-
cdef DPCTLSyclQueueRef get_queue_ref(self)
80+
cdef DPCTLSyclQueueRef get_queue_ref(self)
8181
cpdef SyclEvent _submit_keep_args_alive(
8282
self,
8383
object args,

dpctl/program/_program.pxd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ cdef api class SyclKernelBundle [
5555
cdef bint _is_sycl_source
5656

5757
@staticmethod
58-
cdef SyclKernelBundle _create (DPCTLSyclKernelBundleRef kbref,
59-
bint _is_sycl_source)
60-
cdef DPCTLSyclKernelBundleRef get_kernel_bundle_ref (self)
58+
cdef SyclKernelBundle _create (DPCTLSyclKernelBundleRef kbref,
59+
bint _is_sycl_source)
60+
cdef DPCTLSyclKernelBundleRef get_kernel_bundle_ref (self)
6161
cpdef SyclKernel get_sycl_kernel(self, str kernel_name)
6262

6363

dpctl/program/_program.pyx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,15 @@ cdef class SyclKernelBundle:
246246
247247
SyclKernelBundle exposes the C API from
248248
``dpctl_sycl_kernel_bundle_interface.h``. A SyclKernelBundle can be
249-
created from either a source string or a SPIR-V binary file.
249+
created from an OpenCL C source string
250+
(:func:`.create_kernel_bundle_from_source`), a SPIR-V binary file
251+
(:func:`.create_kernel_bundle_from_spirv`), or a SYCL source string
252+
(:func:`.create_kernel_bundle_from_sycl_source`).
253+
254+
Creation from SYCL source uses the DPC++ ``kernel_compiler`` extension,
255+
which requires both a compiler and a device that support it. Use
256+
:func:`.is_sycl_source_compilation_available` to check for compiler
257+
support.
250258
"""
251259

252260
@staticmethod

dpctl/tests/test_sycl_program.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -551,18 +551,17 @@ def test_create_kernel_bundle_from_invalid_src_sycl(queue_selector):
551551
out[globalID] = in1[globalID] + in2[globalID];
552552
}
553553
"""
554-
try:
555-
_ = dpctl.program.create_kernel_bundle_from_sycl_source(
554+
with pytest.raises(
555+
dpctl_prog.SyclKernelBundleCompilationError,
556+
match="error: expected ';' at end of declaration",
557+
):
558+
dpctl.program.create_kernel_bundle_from_sycl_source(
556559
q,
557560
sycl_source,
558561
headers=[],
559562
registered_names=[],
560563
copts=[],
561564
)
562-
assert False
563-
except dpctl_prog.SyclKernelBundleCompilationError as prog_error:
564-
print(str(prog_error))
565-
assert "error: expected ';' at end of declaration" in str(prog_error)
566565

567566

568567
def test_sycl_source_compilation_is_available_returns_bool():

0 commit comments

Comments
 (0)