Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions samples/Ch02_where_code_runs/fig_2_19.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ class handler {

// Submit a memset operation writing
// to the specified pointer.
// Return an event representing this operation.
event memset(void *ptr, int value, size_t count);
void memset(void *ptr, int value, size_t count);

// Submit a memcpy operation copying from src to dest.
// Return an event representing this operation.
event memcpy(void *dest, const void *src, size_t count);
void memcpy(void *dest, const void *src, size_t count);

// Copy to/from an accessor and host memory.
// Accessors are required to have appropriate correct
Expand Down
18 changes: 9 additions & 9 deletions samples/Ch03_data_management/fig_3_17.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

class handler {
...
// Specifies event(s) that must be complete before the
// action defined in this command group executes.
void depends_on({event / std::vector<event> & });
// Specifies event(s) that must be complete before the
// action defined in this command group executes.
void depends_on({event / std::vector<event> & });

// Enqueues a memcpy from Src to Dest.
// Count bytes are copied.
Expand All @@ -24,20 +24,20 @@ class handler {
// Writes the first byte of Value into Count bytes.
void memset(void* Ptr, int Value, size_t Count)

// Enques a fill operation on the specified pointer.
// Fills Pattern into Ptr Count times.
template <typename T>
void fill(void* Ptr, const T& Pattern, size_t Count);
// Enques a fill operation on the specified pointer.
// Fills Pattern into Ptr Count times.
template <typename T>
void fill(void* Ptr, const T& Pattern, size_t Count);

// Submits a kernel of one work-item for execution.
template <typename KernelName, typename KernelType>
void single_task(KernelType KernelFunc);

// Submits a kernel with NumWork-items work-items for
// Submits a kernel with NumWorkItems work-items for
// execution.
template <typename KernelName, typename KernelType,
int Dims>
void parallel_for(range<Dims> NumWork - items,
void parallel_for(range<Dims> NumWorkItems,
KernelType KernelFunc);

// Submits a kernel for execution over the supplied
Expand Down
7 changes: 7 additions & 0 deletions second_edition_errata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@ 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.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.

Expand Down