Skip to content
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
282 changes: 129 additions & 153 deletions sycl/include/CL/__spirv/spirv_ops.hpp

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions sycl/include/sycl/accessor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2232,7 +2232,7 @@ class __SYCL_SPECIAL_CLASS accessor<DataT, Dimensions, AccessMode,
access::target::image, IsPlaceholder> {
public:
template <typename AllocatorT>
accessor(cl::sycl::image<Dimensions, AllocatorT> &Image,
accessor(sycl::image<Dimensions, AllocatorT> &Image,
handler &CommandGroupHandler)
: detail::image_accessor<DataT, Dimensions, AccessMode,
access::target::image, IsPlaceholder>(
Expand All @@ -2245,7 +2245,7 @@ class __SYCL_SPECIAL_CLASS accessor<DataT, Dimensions, AccessMode,
}

template <typename AllocatorT>
accessor(cl::sycl::image<Dimensions, AllocatorT> &Image,
accessor(sycl::image<Dimensions, AllocatorT> &Image,
handler &CommandGroupHandler, const property_list &propList)
: detail::image_accessor<DataT, Dimensions, AccessMode,
access::target::image, IsPlaceholder>(
Expand Down Expand Up @@ -2291,13 +2291,13 @@ class accessor<DataT, Dimensions, AccessMode, access::target::host_image,
access::target::host_image, IsPlaceholder> {
public:
template <typename AllocatorT>
accessor(cl::sycl::image<Dimensions, AllocatorT> &Image)
accessor(sycl::image<Dimensions, AllocatorT> &Image)
: detail::image_accessor<DataT, Dimensions, AccessMode,
access::target::host_image, IsPlaceholder>(
Image, (detail::getSyclObjImpl(Image))->getElementSize()) {}

template <typename AllocatorT>
accessor(cl::sycl::image<Dimensions, AllocatorT> &Image,
accessor(sycl::image<Dimensions, AllocatorT> &Image,
const property_list &propList)
: detail::image_accessor<DataT, Dimensions, AccessMode,
access::target::host_image, IsPlaceholder>(
Expand Down Expand Up @@ -2339,7 +2339,7 @@ class __SYCL_SPECIAL_CLASS accessor<DataT, Dimensions, AccessMode,
#endif
public:
template <typename AllocatorT>
accessor(cl::sycl::image<Dimensions + 1, AllocatorT> &Image,
accessor(sycl::image<Dimensions + 1, AllocatorT> &Image,
handler &CommandGroupHandler)
: detail::image_accessor<DataT, Dimensions + 1, AccessMode,
access::target::image, IsPlaceholder>(
Expand All @@ -2352,7 +2352,7 @@ class __SYCL_SPECIAL_CLASS accessor<DataT, Dimensions, AccessMode,
}

template <typename AllocatorT>
accessor(cl::sycl::image<Dimensions + 1, AllocatorT> &Image,
accessor(sycl::image<Dimensions + 1, AllocatorT> &Image,
handler &CommandGroupHandler, const property_list &propList)
: detail::image_accessor<DataT, Dimensions + 1, AccessMode,
access::target::image, IsPlaceholder>(
Expand Down Expand Up @@ -2615,13 +2615,13 @@ host_accessor(buffer<DataT, Dimensions, AllocatorT>, Type1, Type2, Type3, Type4,
} // __SYCL_INLINE_NAMESPACE(cl)

namespace std {
template <typename DataT, int Dimensions, cl::sycl::access::mode AccessMode,
cl::sycl::access::target AccessTarget,
cl::sycl::access::placeholder IsPlaceholder>
struct hash<cl::sycl::accessor<DataT, Dimensions, AccessMode, AccessTarget,
IsPlaceholder>> {
using AccType = cl::sycl::accessor<DataT, Dimensions, AccessMode,
AccessTarget, IsPlaceholder>;
template <typename DataT, int Dimensions, sycl::access::mode AccessMode,
sycl::access::target AccessTarget,
sycl::access::placeholder IsPlaceholder>
struct hash<sycl::accessor<DataT, Dimensions, AccessMode, AccessTarget,
IsPlaceholder>> {
using AccType = sycl::accessor<DataT, Dimensions, AccessMode, AccessTarget,
IsPlaceholder>;

size_t operator()(const AccType &A) const {
#ifdef __SYCL_DEVICE_ONLY__
Expand All @@ -2631,7 +2631,7 @@ struct hash<cl::sycl::accessor<DataT, Dimensions, AccessMode, AccessTarget,
#else
// getSyclObjImpl() here returns a pointer to either AccessorImplHost
// or LocalAccessorImplHost depending on the AccessTarget.
auto AccImplPtr = cl::sycl::detail::getSyclObjImpl(A);
auto AccImplPtr = sycl::detail::getSyclObjImpl(A);
return hash<decltype(AccImplPtr)>()(AccImplPtr);
#endif
}
Expand Down
26 changes: 13 additions & 13 deletions sycl/include/sycl/aliases.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class half;
} // __SYCL_INLINE_NAMESPACE(cl)

#define __SYCL_MAKE_VECTOR_ALIAS(ALIAS, TYPE, N) \
using ALIAS##N = cl::sycl::vec<TYPE, N>;
using ALIAS##N = sycl::vec<TYPE, N>;

#define __SYCL_MAKE_VECTOR_ALIASES_FOR_ARITHMETIC_TYPES(N) \
__SYCL_MAKE_VECTOR_ALIAS(char, char, N) \
Expand All @@ -38,17 +38,17 @@ class half;
__SYCL_MAKE_VECTOR_ALIAS(half, half, N)

#define __SYCL_MAKE_VECTOR_ALIASES_FOR_OPENCL_TYPES(N) \
__SYCL_MAKE_VECTOR_ALIAS(cl_char, cl::sycl::cl_char, N) \
__SYCL_MAKE_VECTOR_ALIAS(cl_uchar, cl::sycl::cl_uchar, N) \
__SYCL_MAKE_VECTOR_ALIAS(cl_short, cl::sycl::cl_short, N) \
__SYCL_MAKE_VECTOR_ALIAS(cl_ushort, cl::sycl::cl_ushort, N) \
__SYCL_MAKE_VECTOR_ALIAS(cl_int, cl::sycl::cl_int, N) \
__SYCL_MAKE_VECTOR_ALIAS(cl_uint, cl::sycl::cl_uint, N) \
__SYCL_MAKE_VECTOR_ALIAS(cl_long, cl::sycl::cl_long, N) \
__SYCL_MAKE_VECTOR_ALIAS(cl_ulong, cl::sycl::cl_ulong, N) \
__SYCL_MAKE_VECTOR_ALIAS(cl_float, cl::sycl::cl_float, N) \
__SYCL_MAKE_VECTOR_ALIAS(cl_double, cl::sycl::cl_double, N) \
__SYCL_MAKE_VECTOR_ALIAS(cl_half, cl::sycl::cl_half, N)
__SYCL_MAKE_VECTOR_ALIAS(cl_char, sycl::cl_char, N) \
__SYCL_MAKE_VECTOR_ALIAS(cl_uchar, sycl::cl_uchar, N) \
__SYCL_MAKE_VECTOR_ALIAS(cl_short, sycl::cl_short, N) \
__SYCL_MAKE_VECTOR_ALIAS(cl_ushort, sycl::cl_ushort, N) \
__SYCL_MAKE_VECTOR_ALIAS(cl_int, sycl::cl_int, N) \
__SYCL_MAKE_VECTOR_ALIAS(cl_uint, sycl::cl_uint, N) \
__SYCL_MAKE_VECTOR_ALIAS(cl_long, sycl::cl_long, N) \
__SYCL_MAKE_VECTOR_ALIAS(cl_ulong, sycl::cl_ulong, N) \
__SYCL_MAKE_VECTOR_ALIAS(cl_float, sycl::cl_float, N) \
__SYCL_MAKE_VECTOR_ALIAS(cl_double, sycl::cl_double, N) \
__SYCL_MAKE_VECTOR_ALIAS(cl_half, sycl::cl_half, N)

#define __SYCL_MAKE_VECTOR_ALIASES_FOR_SIGNED_AND_UNSIGNED_TYPES(N) \
__SYCL_MAKE_VECTOR_ALIAS(schar, signed char, N) \
Expand All @@ -74,7 +74,7 @@ using uint = unsigned int;
using ulong = unsigned long;
using longlong = long long;
using ulonglong = unsigned long long;
using half = cl::sycl::detail::half_impl::half;
using half = sycl::detail::half_impl::half;
using cl_bool = bool;
using cl_char = std::int8_t;
using cl_uchar = std::uint8_t;
Expand Down
28 changes: 14 additions & 14 deletions sycl/include/sycl/atomic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class multi_ptr;

namespace detail {

using memory_order = cl::sycl::memory_order;
using memory_order = sycl::memory_order;

template <typename T> struct IsValidAtomicType {
static constexpr bool value =
Expand All @@ -45,14 +45,14 @@ template <typename T> struct IsValidAtomicType {
std::is_same<T, float>::value);
};

template <cl::sycl::access::address_space AS> struct IsValidAtomicAddressSpace {
template <sycl::access::address_space AS> struct IsValidAtomicAddressSpace {
static constexpr bool value =
(AS == access::address_space::global_space ||
AS == access::address_space::local_space ||
AS == access::address_space::ext_intel_global_device_space);
};

// Type trait to translate a cl::sycl::access::address_space to
// Type trait to translate a sycl::access::address_space to
// a SPIR-V memory scope
template <access::address_space AS> struct GetSpirvMemoryScope {};
template <> struct GetSpirvMemoryScope<access::address_space::global_space> {
Expand All @@ -76,7 +76,7 @@ template <> struct GetSpirvMemoryScope<access::address_space::local_space> {
__SYCL_INLINE_NAMESPACE(cl) {
namespace sycl {
namespace detail {
// Translate cl::sycl::memory_order or __spv::MemorySemanticsMask::Flag
// Translate sycl::memory_order or __spv::MemorySemanticsMask::Flag
// into std::memory_order
// Only relaxed memory semantics are supported currently
static inline std::memory_order
Expand All @@ -92,55 +92,55 @@ getStdMemoryOrder(__spv::MemorySemanticsMask::Flag) {
template <typename T>
void __spirv_AtomicStore(std::atomic<T> *Ptr, __spv::Scope::Flag,
__spv::MemorySemanticsMask::Flag MS, T V) {
Ptr->store(V, ::cl::sycl::detail::getStdMemoryOrder(MS));
Ptr->store(V, ::sycl::detail::getStdMemoryOrder(MS));
}

template <typename T>
T __spirv_AtomicLoad(const std::atomic<T> *Ptr, __spv::Scope::Flag,
__spv::MemorySemanticsMask::Flag MS) {
return Ptr->load(::cl::sycl::detail::getStdMemoryOrder(MS));
return Ptr->load(::sycl::detail::getStdMemoryOrder(MS));
}

template <typename T>
T __spirv_AtomicExchange(std::atomic<T> *Ptr, __spv::Scope::Flag,
__spv::MemorySemanticsMask::Flag MS, T V) {
return Ptr->exchange(V, ::cl::sycl::detail::getStdMemoryOrder(MS));
return Ptr->exchange(V, ::sycl::detail::getStdMemoryOrder(MS));
}

template <typename T>
extern T __spirv_AtomicIAdd(std::atomic<T> *Ptr, __spv::Scope::Flag,
__spv::MemorySemanticsMask::Flag MS, T V) {
return Ptr->fetch_add(V, ::cl::sycl::detail::getStdMemoryOrder(MS));
return Ptr->fetch_add(V, ::sycl::detail::getStdMemoryOrder(MS));
}

template <typename T>
extern T __spirv_AtomicISub(std::atomic<T> *Ptr, __spv::Scope::Flag,
__spv::MemorySemanticsMask::Flag MS, T V) {
return Ptr->fetch_sub(V, ::cl::sycl::detail::getStdMemoryOrder(MS));
return Ptr->fetch_sub(V, ::sycl::detail::getStdMemoryOrder(MS));
}

template <typename T>
extern T __spirv_AtomicAnd(std::atomic<T> *Ptr, __spv::Scope::Flag,
__spv::MemorySemanticsMask::Flag MS, T V) {
return Ptr->fetch_and(V, ::cl::sycl::detail::getStdMemoryOrder(MS));
return Ptr->fetch_and(V, ::sycl::detail::getStdMemoryOrder(MS));
}

template <typename T>
extern T __spirv_AtomicOr(std::atomic<T> *Ptr, __spv::Scope::Flag,
__spv::MemorySemanticsMask::Flag MS, T V) {
return Ptr->fetch_or(V, ::cl::sycl::detail::getStdMemoryOrder(MS));
return Ptr->fetch_or(V, ::sycl::detail::getStdMemoryOrder(MS));
}

template <typename T>
extern T __spirv_AtomicXor(std::atomic<T> *Ptr, __spv::Scope::Flag,
__spv::MemorySemanticsMask::Flag MS, T V) {
return Ptr->fetch_xor(V, ::cl::sycl::detail::getStdMemoryOrder(MS));
return Ptr->fetch_xor(V, ::sycl::detail::getStdMemoryOrder(MS));
}

template <typename T>
extern T __spirv_AtomicMin(std::atomic<T> *Ptr, __spv::Scope::Flag,
__spv::MemorySemanticsMask::Flag MS, T V) {
std::memory_order MemoryOrder = ::cl::sycl::detail::getStdMemoryOrder(MS);
std::memory_order MemoryOrder = ::sycl::detail::getStdMemoryOrder(MS);
T Val = Ptr->load(MemoryOrder);
while (V < Val) {
if (Ptr->compare_exchange_strong(Val, V, MemoryOrder, MemoryOrder))
Expand All @@ -153,7 +153,7 @@ extern T __spirv_AtomicMin(std::atomic<T> *Ptr, __spv::Scope::Flag,
template <typename T>
extern T __spirv_AtomicMax(std::atomic<T> *Ptr, __spv::Scope::Flag,
__spv::MemorySemanticsMask::Flag MS, T V) {
std::memory_order MemoryOrder = ::cl::sycl::detail::getStdMemoryOrder(MS);
std::memory_order MemoryOrder = ::sycl::detail::getStdMemoryOrder(MS);
T Val = Ptr->load(MemoryOrder);
while (V > Val) {
if (Ptr->compare_exchange_strong(Val, V, MemoryOrder, MemoryOrder))
Expand Down
7 changes: 3 additions & 4 deletions sycl/include/sycl/atomic_ref.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ __SYCL_INLINE_NAMESPACE(cl) {
namespace sycl {
namespace detail {

using memory_order = cl::sycl::memory_order;
using memory_scope = cl::sycl::memory_scope;
using memory_order = sycl::memory_order;
using memory_scope = sycl::memory_scope;

template <typename T> struct IsValidAtomicRefType {
static constexpr bool value =
Expand All @@ -39,8 +39,7 @@ template <typename T> struct IsValidAtomicRefType {
std::is_pointer<T>::value);
};

template <cl::sycl::access::address_space AS>
struct IsValidAtomicRefAddressSpace {
template <sycl::access::address_space AS> struct IsValidAtomicRefAddressSpace {
static constexpr bool value =
(AS == access::address_space::global_space ||
AS == access::address_space::local_space ||
Expand Down
23 changes: 11 additions & 12 deletions sycl/include/sycl/buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,14 @@ class buffer {
sizeof(T), rangeToArray(Range).data());

if (b.is_sub_buffer())
throw cl::sycl::invalid_object_error(
throw sycl::invalid_object_error(
"Cannot create sub buffer from sub buffer.", PI_ERROR_INVALID_VALUE);
if (isOutOfBounds(baseIndex, subRange, b.Range))
throw cl::sycl::invalid_object_error(
throw sycl::invalid_object_error(
"Requested sub-buffer size exceeds the size of the parent buffer",
PI_ERROR_INVALID_VALUE);
if (!isContiguousRegion(baseIndex, subRange, b.Range))
throw cl::sycl::invalid_object_error(
throw sycl::invalid_object_error(
"Requested sub-buffer region is not contiguous",
PI_ERROR_INVALID_VALUE);
}
Expand Down Expand Up @@ -434,7 +434,7 @@ class buffer {
id<dimensions> accessOffset = {},
const detail::code_location CodeLoc = detail::code_location::current()) {
if (isOutOfBounds(accessOffset, accessRange, this->Range))
throw cl::sycl::invalid_object_error(
throw sycl::invalid_object_error(
"Requested accessor would exceed the bounds of the buffer",
PI_ERROR_INVALID_VALUE);

Expand All @@ -450,7 +450,7 @@ class buffer {
range<dimensions> accessRange, id<dimensions> accessOffset = {},
const detail::code_location CodeLoc = detail::code_location::current()) {
if (isOutOfBounds(accessOffset, accessRange, this->Range))
throw cl::sycl::invalid_object_error(
throw sycl::invalid_object_error(
"Requested accessor would exceed the bounds of the buffer",
PI_ERROR_INVALID_VALUE);

Expand Down Expand Up @@ -495,7 +495,7 @@ class buffer {
buffer<ReinterpretT, ReinterpretDim, AllocatorT>
reinterpret(range<ReinterpretDim> reinterpretRange) const {
if (sizeof(ReinterpretT) * reinterpretRange.size() != byte_size())
throw cl::sycl::invalid_object_error(
throw sycl::invalid_object_error(
"Total size in bytes represented by the type and range of the "
"reinterpreted SYCL buffer does not equal the total size in bytes "
"represented by the type and range of this SYCL buffer",
Expand All @@ -522,7 +522,7 @@ class buffer {
reinterpret() const {
long sz = byte_size();
if (sz % sizeof(ReinterpretT) != 0)
throw cl::sycl::invalid_object_error(
throw sycl::invalid_object_error(
"Total byte size of buffer is not evenly divisible by the size of "
"the reinterpreted type",
PI_ERROR_INVALID_VALUE);
Expand Down Expand Up @@ -680,11 +680,10 @@ buffer(const T *, const range<dimensions> &, const property_list & = {})

namespace std {
template <typename T, int dimensions, typename AllocatorT>
struct hash<cl::sycl::buffer<T, dimensions, AllocatorT>> {
size_t
operator()(const cl::sycl::buffer<T, dimensions, AllocatorT> &b) const {
return hash<std::shared_ptr<cl::sycl::detail::buffer_impl>>()(
cl::sycl::detail::getSyclObjImpl(b));
struct hash<sycl::buffer<T, dimensions, AllocatorT>> {
size_t operator()(const sycl::buffer<T, dimensions, AllocatorT> &b) const {
return hash<std::shared_ptr<sycl::detail::buffer_impl>>()(
sycl::detail::getSyclObjImpl(b));
}
};
} // namespace std
8 changes: 4 additions & 4 deletions sycl/include/sycl/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,10 @@ class __SYCL_EXPORT context {
} // __SYCL_INLINE_NAMESPACE(cl)

namespace std {
template <> struct hash<cl::sycl::context> {
size_t operator()(const cl::sycl::context &Context) const {
return hash<std::shared_ptr<cl::sycl::detail::context_impl>>()(
cl::sycl::detail::getSyclObjImpl(Context));
template <> struct hash<sycl::context> {
size_t operator()(const sycl::context &Context) const {
return hash<std::shared_ptr<sycl::detail::context_impl>>()(
sycl::detail::getSyclObjImpl(Context));
}
};
} // namespace std
12 changes: 6 additions & 6 deletions sycl/include/sycl/detail/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ template <int dimensions = 1> class array {
array() : array(0, 0, 0) {}

// Conversion operators to derived classes
operator cl::sycl::id<dimensions>() const {
cl::sycl::id<dimensions> result;
operator sycl::id<dimensions>() const {
sycl::id<dimensions> result;
for (int i = 0; i < dimensions; ++i) {
result[i] = common_array[i];
}
return result;
}

operator cl::sycl::range<dimensions>() const {
cl::sycl::range<dimensions> result;
operator sycl::range<dimensions>() const {
sycl::range<dimensions> result;
for (int i = 0; i < dimensions; ++i) {
result[i] = common_array[i];
}
Expand Down Expand Up @@ -111,8 +111,8 @@ template <int dimensions = 1> class array {
__SYCL_ALWAYS_INLINE void check_dimension(int dimension) const {
#ifndef __SYCL_DEVICE_ONLY__
if (dimension >= dimensions || dimension < 0) {
throw cl::sycl::invalid_parameter_error("Index out of range",
PI_ERROR_INVALID_VALUE);
throw sycl::invalid_parameter_error("Index out of range",
PI_ERROR_INVALID_VALUE);
}
#endif
(void)dimension;
Expand Down
Loading