Skip to content

Commit 24e59e2

Browse files
authored
FPGA: fix namespaces for host_ptr and device_ptr (#2364)
The host_ptr and device_ptr constructs have been moved to the sycl::ext:intel:: namespace.
1 parent c5db3ff commit 24e59e2

File tree

13 files changed

+42
-42
lines changed

13 files changed

+42
-42
lines changed

DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/board_test/src/usm_speed.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ enum USMTest { MEMCOPY, READ, WRITE };
1919
sycl::event memcopy_kernel(sycl::queue &q, sycl::ulong8 *in, sycl::ulong8 *out,
2020
size_t num_items) {
2121
return q.single_task<USMMemCopy>([=]() [[intel::kernel_args_restrict]] {
22-
sycl::host_ptr<sycl::ulong8> in_h(in);
23-
sycl::host_ptr<sycl::ulong8> out_h(out);
22+
sycl::ext::intel::host_ptr<sycl::ulong8> in_h(in);
23+
sycl::ext::intel::host_ptr<sycl::ulong8> out_h(out);
2424
for (size_t i = 0; i < num_items; i++) {
2525
out_h[i] = in_h[i];
2626
}
@@ -32,8 +32,8 @@ sycl::event memcopy_kernel(sycl::queue &q, sycl::ulong8 *in, sycl::ulong8 *out,
3232
sycl::event read_kernel(sycl::queue &q, sycl::ulong8 *in, sycl::ulong8 *out,
3333
size_t num_items) {
3434
return q.single_task<USMMemRead>([=]() {
35-
sycl::host_ptr<sycl::ulong8> in_h(in);
36-
sycl::host_ptr<sycl::ulong8> out_h(out);
35+
sycl::ext::intel::host_ptr<sycl::ulong8> in_h(in);
36+
sycl::ext::intel::host_ptr<sycl::ulong8> out_h(out);
3737
sycl::ulong8 sum{0};
3838
for (size_t i = 0; i < num_items; i++) {
3939
sum += in_h[i];
@@ -47,7 +47,7 @@ sycl::event read_kernel(sycl::queue &q, sycl::ulong8 *in, sycl::ulong8 *out,
4747
sycl::event write_kernel(sycl::queue &q, sycl::ulong8 *in, sycl::ulong8 *out,
4848
size_t num_items) {
4949
return q.single_task<USMMemWrite>([=]() {
50-
sycl::host_ptr<sycl::ulong8> out_h(out);
50+
sycl::ext::intel::host_ptr<sycl::ulong8> out_h(out);
5151
sycl::ulong8 answer{TEST_VAL};
5252
for (size_t i = 0; i < num_items; i++) {
5353
out_h[i] = answer;
@@ -184,4 +184,4 @@ int run_test(sycl::queue &q, USMTest test) {
184184
<< std::endl;
185185

186186
return 0;
187-
}
187+
}

DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/cholesky/src/cholesky.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ void CholeskyDecompositionImpl(
114114
// lives on the device.
115115
// Knowing this, the compiler won't generate hardware to
116116
// potentially get data from the host.
117-
sycl::device_ptr<TT> vector_ptr(l_device);
117+
sycl::ext::intel::device_ptr<TT> vector_ptr(l_device);
118118
#else
119119
// Device pointers are not supported when targeting an FPGA
120120
// family/part

DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/cholesky/src/memory_transfers.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void MatrixReadFromDDRToPipe(
5050
// lives on the device.
5151
// Knowing this, the compiler won't generate hardware to
5252
// potentially get data from the host.
53-
sycl::device_ptr<TT> matrix_ptr_located(matrix_ptr);
53+
sycl::ext::intel::device_ptr<TT> matrix_ptr_located(matrix_ptr);
5454
#else
5555
// Device pointers are not supported when targeting an FPGA
5656
// family/part
@@ -105,4 +105,4 @@ void MatrixReadFromDDRToPipe(
105105
} // end of repetition
106106
}
107107

108-
#endif /* __MEMORY_TRANSFERS_HPP__ */
108+
#endif /* __MEMORY_TRANSFERS_HPP__ */

DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/cholesky_inversion/src/memory_transfers.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void MatrixReadFromDDRToPipe(
4343
// lives on the device.
4444
// Knowing this, the compiler won't generate hardware to
4545
// potentially get data from the host.
46-
sycl::device_ptr<TT> matrix_ptr_located(matrix_ptr);
46+
sycl::ext::intel::device_ptr<TT> matrix_ptr_located(matrix_ptr);
4747
#else
4848
// Device pointers are not supported when targeting an FPGA
4949
// family/part
@@ -133,7 +133,7 @@ void VectorReadFromPipeToDDR(
133133
// lives on the device.
134134
// Knowing this, the compiler won't generate hardware to
135135
// potentially get data from the host.
136-
sycl::device_ptr<TT> vector_ptr_located(vector_ptr);
136+
sycl::ext::intel::device_ptr<TT> vector_ptr_located(vector_ptr);
137137
#else
138138
// Device pointers are not supported when targeting an FPGA
139139
// family/part
@@ -176,4 +176,4 @@ void VectorReadFromPipeToDDR(
176176
} // end of rep_idx
177177
}
178178

179-
#endif /* __MEMORY_TRANSFERS_HPP__ */
179+
#endif /* __MEMORY_TRANSFERS_HPP__ */

DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/decompress/src/common/common.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ sycl::event SubmitProducer(sycl::queue& q, unsigned in_count_padded,
326326
// lives on the device.
327327
// Knowing this, the compiler won't generate hardware to
328328
// potentially get data from the host.
329-
sycl::device_ptr<unsigned char> in(in_ptr);
329+
sycl::ext::intel::device_ptr<unsigned char> in(in_ptr);
330330
#else
331331
// Device pointers are not supported when targeting an FPGA
332332
// family/part
@@ -371,7 +371,7 @@ sycl::event SubmitConsumer(sycl::queue& q, unsigned out_count_padded,
371371
// lives on the device.
372372
// Knowing this, the compiler won't generate hardware to
373373
// potentially get data from the host.
374-
sycl::device_ptr<unsigned char> out(out_ptr);
374+
sycl::ext::intel::device_ptr<unsigned char> out(out_ptr);
375375
#else
376376
// Device pointers are not supported when targeting an FPGA
377377
// family/part

DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/decompress/src/gzip/gzip_metadata_reader.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,9 @@ sycl::event SubmitGzipMetadataReader(sycl::queue& q, int in_count,
290290
// lives on the device.
291291
// Knowing this, the compiler won't generate hardware to
292292
// potentially get data from the host.
293-
sycl::device_ptr<GzipHeaderData> hdr_data(hdr_data_ptr);
294-
sycl::device_ptr<int> crc(crc_ptr);
295-
sycl::device_ptr<int> out_count(out_count_ptr);
293+
sycl::ext::intel::device_ptr<GzipHeaderData> hdr_data(hdr_data_ptr);
294+
sycl::ext::intel::device_ptr<int> crc(crc_ptr);
295+
sycl::ext::intel::device_ptr<int> out_count(out_count_ptr);
296296
#else
297297
// Device pointers are not supported when targeting an FPGA
298298
// family/part
@@ -316,4 +316,4 @@ sycl::event SubmitGzipMetadataReader(sycl::queue& q, int in_count,
316316
});
317317
}
318318

319-
#endif /* __GZIP_METADATA_READER_HPP__ */
319+
#endif /* __GZIP_METADATA_READER_HPP__ */

DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/decompress/src/snappy/snappy_reader.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ sycl::event SubmitSnappyReader(sycl::queue& q, unsigned in_count,
390390
// lives on the device.
391391
// Knowing this, the compiler won't generate hardware to
392392
// potentially get data from the host.
393-
sycl::device_ptr<unsigned> preamble_count(preamble_count_ptr);
393+
sycl::ext::intel::device_ptr<unsigned> preamble_count(preamble_count_ptr);
394394
#else
395395
// Device pointers are not supported when targeting an FPGA
396396
// family/part
@@ -401,4 +401,4 @@ sycl::event SubmitSnappyReader(sycl::queue& q, unsigned in_count,
401401
});
402402
}
403403

404-
#endif /* __SNAPPY_READER_HPP__ */
404+
#endif /* __SNAPPY_READER_HPP__ */

DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/gzip/src/gzipkernel_ll.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ event SubmitCRC(queue &q, size_t block_size, uint32_t *result_crc,
794794
h.single_task<CRC<engineID>>([=]() [[intel::kernel_args_restrict]] {
795795
auto accessor_isz = block_size;
796796

797-
host_ptr<uint32_t> accresult_crc(result_crc);
797+
sycl::ext::intel::host_ptr<uint32_t> accresult_crc(result_crc);
798798

799799
// See comments at top of file, regarding batching.
800800
[[intel::disable_loop_pipelining]]
@@ -2094,17 +2094,17 @@ event SubmitLZReduction(queue &q, size_t block_size, bool last_block,
20942094
// SubmitGzipTasksHelper(); everything to the left of '...' is expanded
20952095
// for each value in ptrs.
20962096

2097-
host_ptr<char> host_pibuf[BatchSize];
2097+
sycl::ext::intel::host_ptr<char> host_pibuf[BatchSize];
20982098
Unroller<0, BatchSize>::step(
2099-
[&](auto i) { host_pibuf[i] = host_ptr<char>(get<i>(ptrs...)); });
2099+
[&](auto i) { host_pibuf[i] = sycl::ext::intel::host_ptr<char>(get<i>(ptrs...)); });
21002100

21012101
// See comments at top of file, regarding batching
21022102
[[intel::disable_loop_pipelining]] for (int iter = 0;
21032103
iter < BatchSize; iter++) {
21042104
const int iter_masked =
21052105
iter % BatchSize; // Hint to the compiler that the access to
21062106
// host_pibuf is bounded.
2107-
host_ptr<char> acc_pibuf =
2107+
sycl::ext::intel::host_ptr<char> acc_pibuf =
21082108
host_pibuf[iter_masked]; // Grab new host pointer on each iteration
21092109
// of the batch loop
21102110

@@ -2465,20 +2465,20 @@ event SubmitStaticHuffman(queue &q, size_t block_size,
24652465

24662466
// See comments in SubmitLZReduction, where the same parameter unpacking
24672467
// is done.
2468-
host_ptr<char> host_pobuf[BatchSize];
2468+
sycl::ext::intel::host_ptr<char> host_pobuf[BatchSize];
24692469
Unroller<0, BatchSize>::step(
2470-
[&](auto i) { host_pobuf[i] = host_ptr<char>(get<i>(ptrs...)); });
2470+
[&](auto i) { host_pobuf[i] = sycl::ext::intel::host_ptr<char>(get<i>(ptrs...)); });
24712471

24722472
auto accessor_isz = block_size;
24732473

2474-
host_ptr<GzipOutInfo> acc_gzip_out(gzip_out_buf);
2474+
sycl::ext::intel::host_ptr<GzipOutInfo> acc_gzip_out(gzip_out_buf);
24752475

24762476
auto acc_eof = last_block ? 1 : 0;
24772477

24782478
// See comments at top of file regarding batching.
24792479
[[intel::disable_loop_pipelining]]
24802480
for (int iter=0; iter < BatchSize; iter++) {
2481-
host_ptr<char> accessor_output = host_pobuf[iter % BatchSize];
2481+
sycl::ext::intel::host_ptr<char> accessor_output = host_pobuf[iter % BatchSize];
24822482

24832483
unsigned int leftover[kVec] = {0};
24842484
Unroller<0, kVec>::step([&](int i) { leftover[i] = 0; });

DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/matmul/src/memory_transfers.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class MatrixReadFromDDRToPipeA {
8080
// the device.
8181
// Knowing this, the compiler won't generate hardware to potentially get
8282
// data from the host.
83-
sycl::device_ptr<TT> a_ptr_located(a_ptr);
83+
sycl::ext::intel::device_ptr<TT> a_ptr_located(a_ptr);
8484
#else
8585
// Device pointers are not supported when targeting an FPGA family/part
8686
TT *a_ptr_located(a_ptr);
@@ -236,7 +236,7 @@ class MatrixReadFromDDRToPipeB {
236236
// the device.
237237
// Knowing this, the compiler won't generate hardware to potentially get
238238
// data from the host.
239-
sycl::device_ptr<TT> b_ptr_located(b_ptr);
239+
sycl::ext::intel::device_ptr<TT> b_ptr_located(b_ptr);
240240
#else
241241
// Device pointers are not supported when targeting an FPGA family/part
242242
TT *b_ptr_located(b_ptr);
@@ -384,7 +384,7 @@ class MatrixReadPipeToDDR {
384384
// the device.
385385
// Knowing this, the compiler won't generate hardware to potentially get
386386
// data from the host.
387-
sycl::device_ptr<TT> c_ptr_located(c_ptr);
387+
sycl::ext::intel::device_ptr<TT> c_ptr_located(c_ptr);
388388
#else
389389
// Device pointers are not supported when targeting an FPGA family/part
390390
TT *c_ptr_located(c_ptr);

DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/pca/src/memory_transfers.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void VectorReadPipeToDDR(
150150
// lives on the device.
151151
// Knowing this, the compiler won't generate hardware to
152152
// potentially get data from the host.
153-
sycl::device_ptr<TT> vector_ptr_located(vector_ptr);
153+
sycl::ext::intel::device_ptr<TT> vector_ptr_located(vector_ptr);
154154
#else
155155
// Device pointers are not supported when targeting an FPGA
156156
// family/part
@@ -169,4 +169,4 @@ void VectorReadPipeToDDR(
169169
} // end of repetition
170170
}
171171

172-
#endif /* __MEMORY_TRANSFERS_HPP__ */
172+
#endif /* __MEMORY_TRANSFERS_HPP__ */

0 commit comments

Comments
 (0)