Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Apress/data-parallel-CPP in…
Browse files Browse the repository at this point in the history
…to main
  • Loading branch information
jamesreinders committed Aug 23, 2021
2 parents f382037 + 390b75c commit 22f9197
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions samples/Ch05_error_handling/fig_5_3_async_error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ using namespace sycl;
// Our simple asynchronous handler function
auto handle_async_error = [](exception_list elist) {
for (auto &e : elist) {
try{ std::rethrow_exception(e); }
try { std::rethrow_exception(e); }
catch ( sycl::exception& e ) {
std::cout << "ASYNC EXCEPTION!!\n";
std::cout << e.what() << "\n";
}
}
};

void say_device (const queue& Q) {
void say_device(const queue& Q) {
std::cout << "Device : "
<< Q.get_device().get_info<info::device::name>() << "\n";
}
Expand Down
2 changes: 1 addition & 1 deletion samples/Ch05_error_handling/fig_5_6_catch_snip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ int main() {

// START CODE SNIP

try{
try {
// Do some SYCL work
} catch (sycl::exception &e) {
// Do something to output or handle the exceptinon
Expand Down
2 changes: 1 addition & 1 deletion samples/Ch05_error_handling/fig_5_7_catch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using namespace sycl;

int main() {
try{
try {
buffer<int> B{ range{16} };

// ERROR: Create sub-buffer larger than size of parent buffer
Expand Down
4 changes: 2 additions & 2 deletions samples/Ch05_error_handling/fig_5_8_lambda_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ using namespace sycl;
// Our simple asynchronous handler function
auto handle_async_error = [](exception_list elist) {
for (auto &e : elist) {
try{ std::rethrow_exception(e); }
try { std::rethrow_exception(e); }
catch ( sycl::exception& e ) {
std::cout << "ASYNC EXCEPTION!!\n";
std::cout << e.what() << "\n";
Expand All @@ -20,7 +20,7 @@ auto handle_async_error = [](exception_list elist) {

// END CODE SNIP

void say_device (const queue& Q) {
void say_device(const queue& Q) {
std::cout << "Device : "
<< Q.get_device().get_info<info::device::name>() << "\n";
}
Expand Down
4 changes: 2 additions & 2 deletions samples/Ch05_error_handling/fig_5_9_default_handler_proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ using namespace sycl;
// Our simple asynchronous handler function
auto handle_async_error = [](exception_list elist) {
for (auto &e : elist) {
try{ std::rethrow_exception(e); }
try { std::rethrow_exception(e); }
catch ( sycl::exception& e ) {
// Print information about the asynchronous exception
}
Expand All @@ -23,7 +23,7 @@ auto handle_async_error = [](exception_list elist) {
// END CODE SNIP


void say_device (const queue& Q) {
void say_device(const queue& Q) {
std::cout << "Device : "
<< Q.get_device().get_info<info::device::name>() << "\n";
}
Expand Down
2 changes: 1 addition & 1 deletion samples/Ch17_fpgas/fig_17_11_fpga_emulator_selector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <CL/sycl/INTEL/fpga_extensions.hpp> // For fpga_selector
using namespace sycl;

void say_device (const queue& Q) {
void say_device(const queue& Q) {
std::cout << "Device : "
<< Q.get_device().get_info<info::device::name>() << "\n";
}
Expand Down
2 changes: 1 addition & 1 deletion samples/Ch17_fpgas/fig_17_9_fpga_selector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <CL/sycl/INTEL/fpga_extensions.hpp> // For fpga_selector
using namespace sycl;

void say_device (const queue& Q) {
void say_device(const queue& Q) {
std::cout << "Device : "
<< Q.get_device().get_info<info::device::name>() << "\n";
}
Expand Down

0 comments on commit 22f9197

Please sign in to comment.