Skip to content

Commit 541cdb9

Browse files
authored
FPGA: Fix namespaces errors for math function calls (#2350)
Versions of host_ptr and device_ptr that are in the sycl:: namespace are deprecated and should be replaced by sycl::ext::intel namespace. Explicitly specifying sycl:: is needed for some code samples.
1 parent decabdf commit 541cdb9

File tree

9 files changed

+12
-12
lines changed

9 files changed

+12
-12
lines changed

DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/anr/src/dma_kernels.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ event SubmitInputDMA(queue &q, T *in_ptr, int rows, int cols, int frames) {
4545
return q.single_task<KernelId>([=]() [[intel::kernel_args_restrict]] {
4646

4747
#if defined (IS_BSP)
48-
device_ptr<T> in(in_ptr);
48+
sycl::ext::intel::device_ptr<T> in(in_ptr);
4949
#else
5050
T* in(in_ptr);
5151
#endif
@@ -90,7 +90,7 @@ event SubmitOutputDMA(queue &q, T *out_ptr, int rows, int cols, int frames) {
9090
return q.single_task<KernelId>([=]() [[intel::kernel_args_restrict]] {
9191

9292
#if defined (IS_BSP)
93-
device_ptr<T> out(out_ptr);
93+
sycl::ext::intel::device_ptr<T> out(out_ptr);
9494
#else
9595
T* out(out_ptr);
9696
#endif

DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/anr/src/intensity_sigma_lut.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class IntensitySigmaLUT {
1818

1919
#if defined (IS_BSP)
2020
// construct from a device_ptr (for constructing from device memory)
21-
IntensitySigmaLUT(device_ptr<float> ptr) {
21+
IntensitySigmaLUT(sycl::ext::intel::device_ptr<float> ptr) {
2222
// use a pipelined LSU to load from device memory since we don't
2323
// care about the performance of the copy.
2424
using PipelinedLSU = ext::intel::lsu<>;

DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/anr/src/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ int main(int argc, char* argv[]) {
103103
#endif
104104

105105
std::cout << "Running on device: "
106-
<< device.get_info<info::device::name>().c_str()
106+
<< device.get_info<sycl::info::device::name>().c_str()
107107
<< std::endl;
108108

109109

@@ -444,7 +444,7 @@ bool Validate(PixelT* val, PixelT* ref, int rows, int cols,
444444
mse /= count;
445445

446446
// compute the PSNR
447-
double psnr = (20 * std::log10(max_i)) - (10 * std::log10(mse));
447+
double psnr = (20 * log10(max_i)) - (10 * log10(mse));
448448

449449
// check PSNR and maximum pixel difference
450450
bool passed = true;

DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/merge_sort/src/consume.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ event Consume(queue& q, ValueT* out_ptr, IndexT total_count, IndexT offset,
2525
// This is only done in the case where we target a BSP as device
2626
// pointers are not supported when targeting an FPGA family/part
2727
#if defined(IS_BSP)
28-
device_ptr<ValueT> out(out_ptr);
28+
sycl::ext::intel::device_ptr<ValueT> out(out_ptr);
2929
#else
3030
ValueT* out(out_ptr);
3131
#endif

DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/merge_sort/src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ int main(int argc, char *argv[]) {
166166
}
167167

168168
std::cout << "Running on device: "
169-
<< device.get_info<info::device::name>().c_str()
169+
<< device.get_info<sycl::info::device::name>().c_str()
170170
<< std::endl;
171171

172172
// the input, output, and reference data

DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/merge_sort/src/produce.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ event Produce(queue& q, ValueT *in_ptr, IndexT count, IndexT in_block_count,
2727
// This is only done in the case where we target a BSP as device
2828
// pointers are not supported when targeting an FPGA family/part
2929
#if defined(IS_BSP)
30-
device_ptr<ValueT> in(in_ptr);
30+
sycl::ext::intel::device_ptr<ValueT> in(in_ptr);
3131
#else
3232
ValueT* in(in_ptr);
3333
#endif

DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/merge_sort/src/sorting_networks.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ event SortNetworkKernel(queue& q, ValueT* out_ptr, IndexT total_count,
110110
// This is only done in the case where we target a BSP as device
111111
// pointers are not supported when targeting an FPGA family/part
112112
#if defined(IS_BSP)
113-
device_ptr<ValueT> out(out_ptr);
113+
sycl::ext::intel::device_ptr<ValueT> out(out_ptr);
114114
#else
115115
ValueT* out(out_ptr);
116116
#endif

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void MatrixReadFromDDRToPipe(
4242
// lives on the device.
4343
// Knowing this, the compiler won't generate hardware to
4444
// potentially get data from the host.
45-
sycl::device_ptr<TT> matrix_ptr_located(matrix_ptr);
45+
sycl::ext::intel::device_ptr<TT> matrix_ptr_located(matrix_ptr);
4646
#else
4747
// Device pointers are not supported when targeting an FPGA
4848
// family/part
@@ -143,7 +143,7 @@ void MatrixReadPipeToDDR(
143143
// lives on the device.
144144
// Knowing this, the compiler won't generate hardware to
145145
// potentially get data from the host.
146-
sycl::device_ptr<TT> matrix_ptr_located(matrix_ptr);
146+
sycl::ext::intel::device_ptr<TT> matrix_ptr_located(matrix_ptr);
147147
#else
148148
// Device pointers are not supported when targeting an FPGA
149149
// family/part

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void QRDecompositionImpl(
109109
// lives on the device.
110110
// Knowing this, the compiler won't generate hardware to
111111
// potentially get data from the host.
112-
sycl::device_ptr<TT> vector_ptr_located(r_device);
112+
sycl::ext::intel::device_ptr<TT> vector_ptr_located(r_device);
113113
#else
114114
// Device pointers are not supported when targeting an FPGA
115115
// family/part

0 commit comments

Comments
 (0)