We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f715119 commit 06b0db6Copy full SHA for 06b0db6
sycl/test-e2e/Basic/nested_queue_submit.cpp
@@ -3,20 +3,20 @@
3
4
#include <cstdlib>
5
#include <sycl/sycl.hpp>
6
+#include <vector>
7
8
void nestedSubmit() {
9
uint32_t n = 1024;
- float *ptr = (float *)malloc(n * sizeof(float));
10
+ std::vector<float> array(n);
11
sycl::queue q{};
12
{
- sycl::buffer<float> buf(ptr, sycl::range<1>{n});
13
+ sycl::buffer<float> buf(array.data(), sycl::range<1>{n});
14
q.submit([&](sycl::handler &h) {
15
auto acc = buf.get_access<sycl::access::mode::write>(h);
16
q.parallel_for<class zero>(sycl::range<1>{n},
17
[=](sycl::id<1> i) { acc[i] = float(0.0); });
18
});
19
}
- free(ptr);
20
21
22
int main() {
0 commit comments