forked from Apress/data-parallel-CPP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsecond_edition_errata.txt
33 lines (25 loc) · 2.1 KB
/
second_edition_errata.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Errata for the Second Edition
The following are known issues contained in the book
Data Parallel C++: Programming Accelerated Systems using C++ and SYCL
by James Reinders, Ben Ashbaugh, James Brodman, Michael Kinsner, John Pennycook, Xinmin Tian (Apress, 2023/2024).
p.252 - Figure 10-3: Because this is an nd_range parallel_for, the argument to
the kernel lambda expression must be an nd_item, not an id.
p.258 - Figure 10-7: Because these functors are used by an nd_range
parallel_for, the argument to the overloaded function call operator() must be an
nd_item, not an id.
p. 332-333 - Figure 13-6. Change "std::array" to "std::vector" as a better coding method.
This example is better written using std:vector instead of std::array to avoid large stack allocation.
On some systems (e.g., Windows), this will prevent a program failure due to stack overflow.
Modified code for Ch13_practical_tips/fig_13_6_queue_profiling_timing.cpp in the GitHub repo.
p. 365 - Figure 14-11: The histogram has B bins, so the reduction should be over B elements and
not over 16 elements. Additionally, the sample should read the data to histogram from the "data"
array rather than reading the id "i".
p. 371 - Figure 14-15: Need to add "sycl::" to the call to "sqrt" to disambiguate which function to call.
Without the explicit namespace the call could be to "sycl::sqrt" or to "std::sqrt".
p. 375 - Figure 24-20: Need to add "sycl::" to the call to "log2" to disambiguate which function to call.
Without the explicit namespace the call could be to "sycl::log2" or to "std::log2".
p. 599-602 - Figure 21-10 with impact on full code for 21-13 & 21-14. Change "std:array" to "std:vector" as a better coding method.
Same as above, this example is better written using std:vector instead of std::array to avoid large stack allocation.
Chapter 21 - examples based on 21-10 (CUDA) and the resulting code (C++ with SYCL)
Modified code for Ch21_migrating_cuda_code/fig_21_10_reverse.cu and Ch21_migrating_cuda_code/fig_21_13-14_reverse_migrated.cpp in the GitHub repo.
See Pull Request #125: switch from std::array to std::vector to avoid large stack allocation.