Skip to content

Commit 6288267

Browse files
authored
Merge pull request #2588 from bopeng1234/2025Hack_github_2292
add exception code to histogram sample
2 parents 7dff33c + 68fb951 commit 6288267

File tree

1 file changed

+10
-2
lines changed
  • DirectProgramming/C++SYCL/ParallelPatterns/histogram/src

1 file changed

+10
-2
lines changed

DirectProgramming/C++SYCL/ParallelPatterns/histogram/src/main.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,15 @@ int main(void) {
118118
// which shows the difference between sparse and dense algorithm output
119119
for (int i = 0; i < N; i++)
120120
if (input[i] == 4) input[i] = rand() % 3;
121-
dense_histogram(input);
122-
sparse_histogram(input);
121+
try
122+
{
123+
dense_histogram(input);
124+
sparse_histogram(input);
125+
}
126+
catch(const std::exception& e)
127+
{
128+
std::cerr << e.what() << '\n';
129+
return -1;
130+
}
123131
return 0;
124132
}

0 commit comments

Comments
 (0)