Moderators: Sascha Willems, walaber
Windows*
The compiler integrates into the following versions of Microsoft Visual Studio*:
Visual Studio 2019
Visual Studio 2017
//************************************
// Compute vector addition in DPC++ on device: sum of the data is returned in
// 3rd parameter "sum_parallel"
//************************************
void VectorAddInDPCPP(
queue& q,
const IntArray &addend_1,
const IntArray &addend_2,
IntArray &sum_parallel)
{
// create the range object for the arrays managed by the buffer
range<1> num_items{array_size};
buffer<int, 1> addend_1_buf(addend_1.data(), num_items);
buffer<int, 1> addend_2_buf(addend_2.data(), num_items);
buffer<int, 1> sum_buf(sum_parallel.data(), num_items);
auto TestKernel = [&](handler &h)
{
auto sum_accessor = sum_buf.get_access<dp_write>(h);
auto addend_1_accessor = addend_1_buf.get_access<dp_read>(h);
auto addend_2_accessor = addend_2_buf.get_access<dp_read>(h);
h.parallel_for(num_items, [=](id<1> i)
{
sum_accessor[i] = addend_1_accessor[i] + addend_2_accessor[i];
});
};
q.submit(TestKernel);
}
void VectorAddInNewton(
ndThreadPool* const threadPool,
const ndArray<ndInt32>& addend_1,
const ndArray<ndInt32>& addend_2,
ndArray<ndInt32>& sum_parallel)
{
auto TestKernel = ndMakeObject::ndFunction([&](ndInt32 threadIndex, ndInt32 threadCount)
{
D_TRACKTIME();
const ndStartEnd startEnd(sum_parallel.GetCount(), threadIndex, threadCount);
for (ndInt32 i = startEnd.m_start; i < startEnd.m_end; ++i)
{
sum_parallel[i] = addend_1[i] + addend_2[i];
}
});
threadPool->ParallelExecute(TestKernel);
}
auto platforms = sycl::platform::get_platforms();
for (auto &platform : platforms)
{
std::cout << "Platform: " << platform.get_info<sycl::info::platform::name>()
<< std::endl;
auto devices = platform.get_devices();
for (auto &device : devices)
{
std::cout << " Device: " << device.get_info<sycl::info::device::name>()
<< std::endl;
}
}
Platform: Intel(R) FPGA Emulation Platform for OpenCL(TM)
Device: Intel(R) FPGA Emulation Device
Platform: Intel(R) OpenCL
Device: Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz
Platform: AMD Accelerated Parallel Processing
Device: Ellesmere
Platform: Intel(R) OpenCL HD Graphics
Device: Intel(R) HD Graphics 630
Platform: Intel(R) Level-Zero
Device: Intel(R) Graphics [0x5912]
Platform: SYCL host platform
Device: SYCL host device
queue q;
for (auto &platform : platforms)
{
auto devices = platform.get_devices();
for (auto &device : devices)
{
auto name = platform.get_info<sycl::info::platform::name>();
int vendorName = name.find("AMD");
//int vendorName = name.find("SYCL host platform");
if (vendorName >= 0)
{
auto info = device.get_info<sycl::info::device::name>();
std::cout << "Platform: " << name << std::endl;
std::cout << " Device: " << info << std::endl;
q = queue(device);
}
}
}
Platform: AMD Accelerated Parallel Processing
Device: Ellesmere
Device: Ellesmere
InvalidBuiltinSetName: Expects OpenCL.std. Actual is SPIRV.debug
[Src: ..\..\..\libSPIRV\SPIRVModule.cpp:594 SPIRVBuiltinSetNameMap::rfind(BuiltinSetName, &BuiltinSet) ]
Exception thrown at 0x00007FF9AAAB80B0 (amdocl64.dll) in DPCPPConsoleApplication1.exe: 0xC0000005: Access violation reading location 0x0000000000000008.
But it seems to me that if anyone download llvm, and modifying Clang
Data Parallel C++: Mastering DPC++ for Programming of Heterogeneous Systems using C++ and SYCL
Julio Jerez wrote:To me, all those shader nonsence should be part of the C++ language.
JoeJ wrote:Afaik, C++23 executors are planned to support running lambdas on GPU.
Thank you for your inquiry. We offer support for hardware platforms that the Intel® oneAPI product supports. These platforms include those that are part of the Intel® Core™ processor family or higher, the Intel® Xeon® processor family, the Intel® Xeon® Scalable processor family, and others which can be found here – Intel® oneAPI Base Toolkit System Requirements, Intel® oneAPI HPC Toolkit System Requirements, Intel® oneAPI IoT Toolkit System Requirements
Users browsing this forum: No registered users and 42 guests