@@ -2024,6 +2024,9 @@ sycl::event gemm_tree_k_impl(sycl::queue &exec_q,
2024
2024
if (reduction_nelems < wg) {
2025
2025
resTy *tmp = sycl::malloc_device<resTy>(
2026
2026
iter_nelems * reduction_nelems, exec_q);
2027
+ if (!tmp) {
2028
+ throw std::runtime_error (" Unable to allocate device memory" );
2029
+ }
2027
2030
sycl::event gemm_ev = exec_q.submit ([&](sycl::handler &cgh) {
2028
2031
cgh.depends_on (depends);
2029
2032
@@ -2144,7 +2147,7 @@ sycl::event gemm_tree_k_impl(sycl::queue &exec_q,
2144
2147
resTy *partially_reduced_tmp2 = nullptr ;
2145
2148
2146
2149
if (partially_reduced_tmp == nullptr ) {
2147
- throw std::runtime_error (" Unable to allocate device_memory " );
2150
+ throw std::runtime_error (" Unable to allocate device memory " );
2148
2151
}
2149
2152
else {
2150
2153
partially_reduced_tmp2 =
@@ -2360,6 +2363,9 @@ sycl::event gemm_tree_nm_impl(sycl::queue &exec_q,
2360
2363
if (reduction_nelems < wg) {
2361
2364
resTy *tmp = sycl::malloc_device<resTy>(
2362
2365
iter_nelems * reduction_nelems, exec_q);
2366
+ if (!tmp) {
2367
+ throw std::runtime_error (" Unable to allocate device memory" );
2368
+ }
2363
2369
sycl::event gemm_ev = exec_q.submit ([&](sycl::handler &cgh) {
2364
2370
cgh.depends_on (depends);
2365
2371
@@ -2768,6 +2774,9 @@ sycl::event gemm_contig_tree_k_impl(sycl::queue &exec_q,
2768
2774
if (reduction_nelems < wg) {
2769
2775
resTy *tmp = sycl::malloc_device<resTy>(
2770
2776
iter_nelems * reduction_nelems, exec_q);
2777
+ if (!tmp) {
2778
+ throw std::runtime_error (" Unable to allocate device memory" );
2779
+ }
2771
2780
sycl::event gemm_ev = exec_q.submit ([&](sycl::handler &cgh) {
2772
2781
cgh.depends_on (depends);
2773
2782
@@ -3092,6 +3101,9 @@ sycl::event gemm_contig_tree_nm_impl(sycl::queue &exec_q,
3092
3101
if (reduction_nelems < wg) {
3093
3102
resTy *tmp = sycl::malloc_device<resTy>(
3094
3103
iter_nelems * reduction_nelems, exec_q);
3104
+ if (!tmp) {
3105
+ throw std::runtime_error (" Unable to allocate device memory" );
3106
+ }
3095
3107
sycl::event gemm_ev = exec_q.submit ([&](sycl::handler &cgh) {
3096
3108
cgh.depends_on (depends);
3097
3109
@@ -5254,6 +5266,9 @@ gemm_batch_tree_k_impl(sycl::queue &exec_q,
5254
5266
if (reduction_nelems < wg) {
5255
5267
resTy *tmp = sycl::malloc_device<resTy>(
5256
5268
iter_nelems * reduction_nelems, exec_q);
5269
+ if (!tmp) {
5270
+ throw std::runtime_error (" Unable to allocate device memory" );
5271
+ }
5257
5272
sycl::event gemm_ev = exec_q.submit ([&](sycl::handler &cgh) {
5258
5273
cgh.depends_on (depends);
5259
5274
@@ -5647,6 +5662,9 @@ gemm_batch_tree_nm_impl(sycl::queue &exec_q,
5647
5662
if (reduction_nelems < wg) {
5648
5663
resTy *tmp = sycl::malloc_device<resTy>(
5649
5664
iter_nelems * reduction_nelems, exec_q);
5665
+ if (!tmp) {
5666
+ throw std::runtime_error (" Unable to allocate device memory" );
5667
+ }
5650
5668
sycl::event gemm_ev = exec_q.submit ([&](sycl::handler &cgh) {
5651
5669
cgh.depends_on (depends);
5652
5670
@@ -6124,6 +6142,9 @@ gemm_batch_contig_tree_k_impl(sycl::queue &exec_q,
6124
6142
if (reduction_nelems < wg) {
6125
6143
resTy *tmp = sycl::malloc_device<resTy>(
6126
6144
iter_nelems * reduction_nelems, exec_q);
6145
+ if (!tmp) {
6146
+ throw std::runtime_error (" Unable to allocate device memory" );
6147
+ }
6127
6148
sycl::event gemm_ev = exec_q.submit ([&](sycl::handler &cgh) {
6128
6149
cgh.depends_on (depends);
6129
6150
@@ -6493,6 +6514,9 @@ gemm_batch_contig_tree_nm_impl(sycl::queue &exec_q,
6493
6514
if (reduction_nelems < wg) {
6494
6515
resTy *tmp = sycl::malloc_device<resTy>(
6495
6516
iter_nelems * reduction_nelems, exec_q);
6517
+ if (!tmp) {
6518
+ throw std::runtime_error (" Unable to allocate device memory" );
6519
+ }
6496
6520
sycl::event gemm_ev = exec_q.submit ([&](sycl::handler &cgh) {
6497
6521
cgh.depends_on (depends);
6498
6522
0 commit comments