-
Notifications
You must be signed in to change notification settings - Fork 85
/
second_edition_errata.txt
46 lines (34 loc) · 2.69 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
34
35
36
37
38
39
40
41
42
43
44
45
46
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.57 - Figure 2-19: The return type for the member functions memset and memcpy
of the handler class is void, not event.
p.79 - Figure 3-6: The comments in the code incorrectly refer to the names
myBuffer and myData instead of my_buffer and my_data.
p.94 - Figure 3-17: The member functions depends_on and fill are declared with
inconsistent indentation. The first parameter of the range parallel_for is not
a valid C++ identifier, need to replace with, e.g., NumWorkItems.
p.125 - Figure 4-19: The group class provides get_group_id and get_group_linear_id
member functions, not get_id nor get_linear_id.
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.