Skip to content

Commit

Permalink
Implement a few cl::sycl::info::device queries
Browse files Browse the repository at this point in the history
Add a few parameters to have the Parallel STL to run
https://github.com/KhronosGroup/SyclParallelSTL
  • Loading branch information
keryell committed Jun 12, 2018
1 parent f1041f2 commit a5b7ee9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/CL/sycl/device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
#ifdef TRISYCL_OPENCL
#include "CL/sycl/device/detail/opencl_device.hpp"
#endif
#include "CL/sycl/id.hpp"
#include "CL/sycl/info/device.hpp"
#include "CL/sycl/device_selector.hpp"
#include "CL/sycl/opencl_types.hpp"
#include "CL/sycl/platform.hpp"

namespace cl {
Expand Down Expand Up @@ -261,6 +263,11 @@ inline auto device::get_info<info::device::max_work_group_size>() const {
return size_t { 8 };
}

template <>
inline auto device::get_info<info::device::max_work_item_sizes>() const {
return cl::sycl::id<3> { 128, 128, 128 };
}

template <>
inline auto device::get_info<info::device::max_compute_units>() const {
return size_t { 8 };
Expand Down
11 changes: 11 additions & 0 deletions include/CL/sycl/info/device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
License. See LICENSE.TXT for details.
*/

#include "CL/sycl/id.hpp"
#include "CL/sycl/opencl_types.hpp"
#include "CL/sycl/info/param_traits.hpp"

namespace cl {
Expand Down Expand Up @@ -189,6 +191,15 @@ using device_queue_properties = unsigned int;
\todo To be implemented, return always void.
*/
TRISYCL_INFO_PARAM_TRAITS_ANY_T(info::device, void)
TRISYCL_INFO_PARAM_TRAITS(info::device::device_type, info::device_type)
TRISYCL_INFO_PARAM_TRAITS(info::device::local_mem_size, cl::sycl::cl_ulong)
TRISYCL_INFO_PARAM_TRAITS(info::device::max_compute_units, cl::sycl::cl_uint)
TRISYCL_INFO_PARAM_TRAITS(info::device::max_mem_alloc_size, cl::sycl::cl_ulong)
TRISYCL_INFO_PARAM_TRAITS(info::device::max_work_group_size, std::size_t)
TRISYCL_INFO_PARAM_TRAITS(info::device::max_work_item_sizes, cl::sycl::id<3>)
TRISYCL_INFO_PARAM_TRAITS(info::device::name, string_class)
TRISYCL_INFO_PARAM_TRAITS(info::device::profile, string_class)
TRISYCL_INFO_PARAM_TRAITS(info::device::vendor, string_class)

}
}
Expand Down

0 comments on commit a5b7ee9

Please sign in to comment.