Skip to content

Replaced deprecated cl::sycl namespace with sycl #898

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion dpctl/_backend.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ cdef extern from "syclinterface/dpctl_sycl_device_interface.h":
cdef bool DPCTLDevice_IsCPU(const DPCTLSyclDeviceRef DRef)
cdef bool DPCTLDevice_IsGPU(const DPCTLSyclDeviceRef DRef)
cdef bool DPCTLDevice_IsHost(const DPCTLSyclDeviceRef DRef)
cdef bool DPCTLDevice_IsHostUnifiedMemory(const DPCTLSyclDeviceRef DRef)
cdef bool DPCTLDevice_GetSubGroupIndependentForwardProgress(const DPCTLSyclDeviceRef DRef)
cdef uint32_t DPCTLDevice_GetPreferredVectorWidthChar(const DPCTLSyclDeviceRef DRef)
cdef uint32_t DPCTLDevice_GetPreferredVectorWidthShort(const DPCTLSyclDeviceRef DRef)
Expand Down
2 changes: 1 addition & 1 deletion dpctl/_sycl_device.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ cdef public api class _SyclDevice [
object Py_SyclDeviceObject,
type Py_SyclDeviceType
]:
""" A helper data-owner class to abstract a `cl::sycl::device` instance.
""" A helper data-owner class to abstract a `sycl::device` instance.
"""
cdef DPCTLSyclDeviceRef _device_ref
cdef const char *_vendor
Expand Down
2 changes: 1 addition & 1 deletion dpctl/_sycl_device.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ cdef class SyclSubDeviceCreationError(Exception):

cdef class _SyclDevice:
"""
A helper data-owner class to abstract a cl::sycl::device instance.
A helper data-owner class to abstract a `sycl::device` instance.
"""

def __dealloc__(self):
Expand Down
2 changes: 1 addition & 1 deletion dpctl/_sycl_event.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ cdef public api class SyclEvent(_SyclEvent) [
object PySyclEventObject,
type PySyclEventType
]:
""" Python wrapper class for a ``cl::sycl::event``
""" Python wrapper class for a ``sycl::event``
"""
@staticmethod
cdef SyclEvent _create (DPCTLSyclEventRef event)
Expand Down
16 changes: 8 additions & 8 deletions dpctl/_sycl_event.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ cdef class _SyclEvent:
cdef class SyclEvent(_SyclEvent):
"""
SyclEvent(arg=None)
Python class representing ``cl::sycl::event``. There are multiple
Python class representing ``sycl::event``. There are multiple
ways to create a :class:`dpctl.SyclEvent` object:

- Invoking the constructor with no arguments creates a ready event
using the default constructor of the ``cl::sycl::event``.
using the default constructor of the ``sycl::event``.

:Example:
.. code-block:: python
Expand Down Expand Up @@ -248,19 +248,19 @@ cdef class SyclEvent(_SyclEvent):

def _get_capsule(self):
"""
Returns a copy of the underlying ``cl::sycl::event`` pointer as a void
Returns a copy of the underlying ``sycl::event`` pointer as a void
pointer inside a named ``PyCapsule`` that has the name
**SyclEventRef**. The ownership of the pointer inside the capsule is
passed to the caller, and pointer is deleted when the capsule goes out
of scope.

Returns:
:class:`pycapsule`: A capsule object storing a copy of the
``cl::sycl::event`` pointer belonging to a
``sycl::event`` pointer belonging to a
:class:`dpctl.SyclEvent` instance.
Raises:
ValueError: If the ``DPCTLEvent_Copy`` fails to copy the
``cl::sycl::event`` pointer.
``sycl::event`` pointer.

"""
cdef DPCTLSyclEventRef ERef = NULL
Expand Down Expand Up @@ -334,7 +334,7 @@ cdef class SyclEvent(_SyclEvent):
def profiling_info_submit(self):
"""
Returns the 64-bit time value in nanoseconds
when ``cl::sycl::command_group`` was submitted to the queue.
when ``sycl::command_group`` was submitted to the queue.
"""
cdef uint64_t profiling_info_submit = 0
profiling_info_submit = DPCTLEvent_GetProfilingInfoSubmit(
Expand All @@ -346,7 +346,7 @@ cdef class SyclEvent(_SyclEvent):
def profiling_info_start(self):
"""
Returns the 64-bit time value in nanoseconds
when ``cl::sycl::command_group`` started execution on the device.
when ``sycl::command_group`` started execution on the device.
"""
cdef uint64_t profiling_info_start = 0
profiling_info_start = DPCTLEvent_GetProfilingInfoStart(self._event_ref)
Expand All @@ -356,7 +356,7 @@ cdef class SyclEvent(_SyclEvent):
def profiling_info_end(self):
"""
Returns the 64-bit time value in nanoseconds
when ``cl::sycl::command_group`` finished execution on the device.
when ``sycl::command_group`` finished execution on the device.
"""
cdef uint64_t profiling_info_end = 0
profiling_info_end = DPCTLEvent_GetProfilingInfoEnd(self._event_ref)
Expand Down
2 changes: 1 addition & 1 deletion dpctl/_sycl_platform.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ from ._backend cimport DPCTLSyclDeviceSelectorRef, DPCTLSyclPlatformRef


cdef class _SyclPlatform:
''' A helper metaclass to abstract a cl::sycl::platform instance.
''' A helper metaclass to abstract a ``sycl::platform`` instance.
'''
cdef DPCTLSyclPlatformRef _platform_ref
cdef const char *_vendor
Expand Down
2 changes: 1 addition & 1 deletion dpctl/_sycl_platform.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ cdef void _init_helper(_SyclPlatform platform, DPCTLSyclPlatformRef PRef):

cdef class SyclPlatform(_SyclPlatform):
""" SyclPlatform(self, arg=None)
Python class representing ``cl::sycl::platform`` class.
Python class representing ``sycl::platform`` class.

SyclPlatform() - create platform selected by sycl::default_selector
SyclPlatform(filter_selector) - create platform selected by filter
Expand Down
4 changes: 2 additions & 2 deletions dpctl/_sycl_queue.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ cdef class _SyclQueue:
cdef class SyclQueue(_SyclQueue):
"""
SyclQueue(*args, **kwargs)
Python class representing ``cl::sycl::queue``. There are multiple
Python class representing ``sycl::queue``. There are multiple
ways to create a :class:`dpctl.SyclQueue` object:

- Invoking the constructor with no arguments creates a context using
Expand Down Expand Up @@ -258,7 +258,7 @@ cdef class SyclQueue(_SyclQueue):
context will be created from the specified device.
dev (str, :class:`dpctl.SyclDevice`, capsule, optional): Sycl device
to create :class:`dpctl.SyclQueue` from. If not specified, sycl
device selected by ``cl::sycl::default_selector`` is used.
device selected by ``sycl::default_selector`` is used.
The argument must be explicitly specified if `ctxt` argument is
provided.

Expand Down
4 changes: 2 additions & 2 deletions examples/cython/sycl_direct_linkage/_buffer_example.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ import numpy as np
from cython.operator cimport dereference as deref


cdef extern from "CL/sycl.hpp" namespace "cl::sycl":
cdef extern from "CL/sycl.hpp" namespace "sycl":
cdef cppclass queue nogil:
pass


cdef extern from "sycl_function.hpp":
int c_columnwise_total(
queue& q, size_t n, size_t m, double *m, double *ct
queue q, size_t n, size_t m, double *m, double *ct
) nogil


Expand Down
2 changes: 1 addition & 1 deletion examples/cython/sycl_direct_linkage/sycl_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <CL/sycl.hpp>
#include <oneapi/mkl.hpp>

int c_columnwise_total(cl::sycl::queue &q,
int c_columnwise_total(sycl::queue q,
size_t n,
size_t m,
double *mat,
Expand Down
2 changes: 1 addition & 1 deletion examples/cython/sycl_direct_linkage/sycl_function.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <CL/sycl.hpp>

int c_columnwise_total(cl::sycl::queue &,
int c_columnwise_total(sycl::queue,
size_t n,
size_t m,
double *mat,
Expand Down
14 changes: 7 additions & 7 deletions examples/cython/usm_memory/sycl_blackscholes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,32 +89,32 @@ cpp_blackscholes(DPCTLSyclQueueRef q_ptr, size_t n_opts, T *params, T *callput)
data_t mr = -opt_rate,
sig_sig_two = two * opt_volatility * opt_volatility;

a = cl::sycl::log(opt_price / opt_strike);
a = sycl::log(opt_price / opt_strike);
b = opt_maturity * mr;
z = opt_maturity * sig_sig_two;

c = quarter * z;
e = cl::sycl::exp(b);
y = cl::sycl::rsqrt(z);
e = sycl::exp(b);
y = sycl::rsqrt(z);

a = b - a;
w1 = (a - c) * y;
w2 = (a + c) * y;

if (w1 < zero) {
d1 = cl::sycl::erfc(w1) * half;
d1 = sycl::erfc(w1) * half;
d1c = one - d1;
}
else {
d1c = cl::sycl::erfc(-w1) * half;
d1c = sycl::erfc(-w1) * half;
d1 = one - d1c;
}
if (w2 < zero) {
d2 = cl::sycl::erfc(w2) * half;
d2 = sycl::erfc(w2) * half;
d2c = one - d2;
}
else {
d2c = cl::sycl::erfc(-w2) * half;
d2c = sycl::erfc(-w2) * half;
d2 = one - d2c;
}

Expand Down
2 changes: 1 addition & 1 deletion examples/python/device_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

def create_default_device():
"""
Create default SyclDevice using `cl::sycl::default_selector`.
Create default SyclDevice using `sycl::default_selector`.

Device created can be influenced by environment variable
SYCL_DEVICE_FILTER, which determines SYCL devices seen by the
Expand Down
2 changes: 1 addition & 1 deletion libsyclinterface/helper/include/dpctl_error_handlers.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class DPCTL_API DPCTL_AsyncErrorHandler
{
}

void operator()(const cl::sycl::exception_list &exceptions);
void operator()(const sycl::exception_list &exceptions);
};

enum error_level : int
Expand Down
3 changes: 1 addition & 2 deletions libsyclinterface/helper/source/dpctl_error_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
#include <glog/logging.h>
#endif

void DPCTL_AsyncErrorHandler::operator()(
const cl::sycl::exception_list &exceptions)
void DPCTL_AsyncErrorHandler::operator()(const sycl::exception_list &exceptions)
{
for (std::exception_ptr const &e : exceptions) {
try {
Expand Down
6 changes: 3 additions & 3 deletions libsyclinterface/helper/source/dpctl_utils_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <sstream>
#include <string>

using namespace cl::sycl;
using namespace sycl;

/*!
* Transforms enum info::device_type to string.
Expand Down Expand Up @@ -164,7 +164,7 @@ DPCTLSyclDeviceType DPCTL_SyclDeviceTypeToDPCTLDeviceType(info::device_type D)
}

/*!
* Transforms cl::sycl::aspect to string.
* Transforms sycl::aspect to string.
*/
std::string DPCTL_AspectToStr(aspect aspectTy)
{
Expand Down Expand Up @@ -237,7 +237,7 @@ std::string DPCTL_AspectToStr(aspect aspectTy)
}

/*!
* Transforms string to cl::sycl::aspect.
* Transforms string to sycl::aspect.
*/
aspect DPCTL_StrToAspectType(const std::string &aspectTyStr)
{
Expand Down
13 changes: 0 additions & 13 deletions libsyclinterface/include/dpctl_sycl_device_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,19 +312,6 @@ DPCTL_API
__dpctl_give const char *
DPCTLDevice_GetVendor(__dpctl_keep const DPCTLSyclDeviceRef DRef);

/*!
* @brief Returns True if the device and the host share a unified memory
* subsystem, else returns False.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Boolean indicating if the device shares a unified memory subsystem
* with the host.
* @ingroup DeviceInterface
*/
DPCTL_API
bool DPCTLDevice_IsHostUnifiedMemory(
__dpctl_keep const DPCTLSyclDeviceRef DRef);

/*!
* @brief Checks if two DPCTLSyclDeviceRef objects point to the same
* sycl::device.
Expand Down
2 changes: 1 addition & 1 deletion libsyclinterface/source/dpctl_sycl_context_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <CL/sycl.hpp>
#include <vector>

using namespace cl::sycl;
using namespace sycl;

namespace
{
Expand Down
16 changes: 1 addition & 15 deletions libsyclinterface/source/dpctl_sycl_device_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <cstring>
#include <vector>

using namespace cl::sycl;
using namespace sycl;

namespace
{
Expand Down Expand Up @@ -367,20 +367,6 @@ DPCTLDevice_GetDriverVersion(__dpctl_keep const DPCTLSyclDeviceRef DRef)
return cstr_driver;
}

bool DPCTLDevice_IsHostUnifiedMemory(__dpctl_keep const DPCTLSyclDeviceRef DRef)
{
bool ret = false;
auto D = unwrap(DRef);
if (D) {
try {
ret = D->get_info<info::device::host_unified_memory>();
} catch (std::exception const &e) {
error_handler(e, __FILE__, __func__, __LINE__);
}
}
return ret;
}

bool DPCTLDevice_AreEq(__dpctl_keep const DPCTLSyclDeviceRef DRef1,
__dpctl_keep const DPCTLSyclDeviceRef DRef2)
{
Expand Down
4 changes: 1 addition & 3 deletions libsyclinterface/source/dpctl_sycl_device_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <unordered_map>
#include <vector>

using namespace cl::sycl;
using namespace sycl;

namespace
{
Expand All @@ -58,8 +58,6 @@ std::string get_device_info_str(const device &Device)
<< Device.get_info<info::device::driver_version>() << _endl
<< std::setw(4) << " " << std::left << std::setw(16) << "Vendor"
<< Device.get_info<info::device::vendor>() << _endl << std::setw(4)
<< " " << std::left << std::setw(16) << "Profile"
<< Device.get_info<info::device::profile>() << _endl << std::setw(4)
<< " " << std::left << std::setw(16) << "Filter string"
<< DPCTL_GetDeviceFilterString(Device) << _endl;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "dpctl_error_handlers.h"
#include <CL/sycl.hpp> /* SYCL headers */

using namespace cl::sycl;
using namespace sycl;

namespace
{
Expand Down
2 changes: 1 addition & 1 deletion libsyclinterface/source/dpctl_sycl_event_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <CL/sycl.hpp> /* SYCL headers */
#include <vector>

using namespace cl::sycl;
using namespace sycl;

namespace
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
// clang-format on
#endif

using namespace cl::sycl;
using namespace sycl;

namespace
{
Expand Down
2 changes: 1 addition & 1 deletion libsyclinterface/source/dpctl_sycl_kernel_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <CL/sycl.hpp> /* Sycl headers */
#include <cstdint>

using namespace cl::sycl;
using namespace sycl;

namespace
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <sstream>
#include <vector>

using namespace cl::sycl;
using namespace sycl;

namespace
{
Expand Down
2 changes: 1 addition & 1 deletion libsyclinterface/source/dpctl_sycl_platform_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <set>
#include <sstream>

using namespace cl::sycl;
using namespace sycl;

namespace
{
Expand Down
Loading