@@ -225,10 +225,9 @@ __esimd_oword_ld_unaligned(SurfIndAliasTy surf_ind, uint32_t offset)
225
225
uint32_t width;
226
226
std::mutex *mutexLock;
227
227
228
- I->sycl_get_cm_buffer_params_index_ptr (surf_ind, &readBase, &width,
229
- &mutexLock);
228
+ I->sycl_get_cm_buffer_params_ptr (surf_ind, &readBase, &width, &mutexLock);
230
229
231
- std::unique_lock <std::mutex> lock (*mutexLock);
230
+ std::lock_guard <std::mutex> lock (*mutexLock);
232
231
233
232
for (int idx = 0 ; idx < N; idx++) {
234
233
if (offset >= width) {
@@ -270,10 +269,9 @@ __ESIMD_INTRIN void __esimd_oword_st(SurfIndAliasTy surf_ind, uint32_t offset,
270
269
uint32_t width;
271
270
std::mutex *mutexLock;
272
271
273
- I->sycl_get_cm_buffer_params_index_ptr (surf_ind, &writeBase, &width,
274
- &mutexLock);
272
+ I->sycl_get_cm_buffer_params_ptr (surf_ind, &writeBase, &width, &mutexLock);
275
273
276
- std::unique_lock <std::mutex> lock (*mutexLock);
274
+ std::lock_guard <std::mutex> lock (*mutexLock);
277
275
278
276
for (int idx = 0 ; idx < N; idx++) {
279
277
if (offset < width) {
@@ -458,11 +456,10 @@ __esimd_scatter_scaled(__ESIMD_DNS::simd_mask_storage_t<N> pred,
458
456
uint32_t width;
459
457
std::mutex *mutexLock;
460
458
461
- I->sycl_get_cm_buffer_params_index_ptr (surf_ind, &writeBase, &width,
462
- &mutexLock);
459
+ I->sycl_get_cm_buffer_params_ptr (surf_ind, &writeBase, &width, &mutexLock);
463
460
writeBase += global_offset;
464
461
465
- std::unique_lock <std::mutex> lock (*mutexLock);
462
+ std::lock_guard <std::mutex> lock (*mutexLock);
466
463
467
464
for (int idx = 0 ; idx < N; idx++) {
468
465
if (pred[idx]) {
@@ -594,11 +591,10 @@ __esimd_gather_scaled(__ESIMD_DNS::simd_mask_storage_t<N> pred,
594
591
uint32_t width;
595
592
std::mutex *mutexLock;
596
593
597
- I->sycl_get_cm_buffer_params_index_ptr (surf_ind, &readBase, &width,
598
- &mutexLock);
594
+ I->sycl_get_cm_buffer_params_ptr (surf_ind, &readBase, &width, &mutexLock);
599
595
readBase += global_offset;
600
596
601
- std::unique_lock <std::mutex> lock (*mutexLock);
597
+ std::lock_guard <std::mutex> lock (*mutexLock);
602
598
603
599
for (int idx = 0 ; idx < N; idx++) {
604
600
if (pred[idx]) {
@@ -672,11 +668,10 @@ __esimd_gather_masked_scaled2(SurfIndAliasTy surf_ind, uint32_t global_offset,
672
668
uint32_t width;
673
669
std::mutex *mutexLock;
674
670
675
- I->sycl_get_cm_buffer_params_index_ptr (surf_ind, &readBase, &width,
676
- &mutexLock);
671
+ I->sycl_get_cm_buffer_params_ptr (surf_ind, &readBase, &width, &mutexLock);
677
672
678
673
readBase += global_offset;
679
- std::unique_lock <std::mutex> lock (*mutexLock);
674
+ std::lock_guard <std::mutex> lock (*mutexLock);
680
675
for (int idx = 0 ; idx < N; idx++) {
681
676
if (pred[idx]) {
682
677
RestoredTy *addr =
@@ -727,10 +722,9 @@ __esimd_oword_ld(SurfIndAliasTy surf_ind, uint32_t addr)
727
722
uint32_t width;
728
723
std::mutex *mutexLock;
729
724
730
- I->sycl_get_cm_buffer_params_index_ptr (surf_ind, &readBase, &width,
731
- &mutexLock);
725
+ I->sycl_get_cm_buffer_params_ptr (surf_ind, &readBase, &width, &mutexLock);
732
726
733
- std::unique_lock <std::mutex> lock (*mutexLock);
727
+ std::lock_guard <std::mutex> lock (*mutexLock);
734
728
735
729
for (int idx = 0 ; idx < N; idx++) {
736
730
if (addr >= width) {
@@ -768,9 +762,8 @@ __ESIMD_INTRIN
768
762
} else {
769
763
uint32_t width;
770
764
std::mutex *mutexLock;
771
- I->sycl_get_cm_buffer_params_index_ptr (surf_ind, &ReadBase, &width,
772
- &mutexLock);
773
- std::unique_lock<std::mutex> lock (*mutexLock);
765
+ I->sycl_get_cm_buffer_params_ptr (surf_ind, &ReadBase, &width, &mutexLock);
766
+ std::lock_guard<std::mutex> lock (*mutexLock);
774
767
}
775
768
776
769
ReadBase += global_offset;
@@ -812,9 +805,8 @@ __ESIMD_INTRIN void __esimd_scatter4_scaled(
812
805
} else {
813
806
uint32_t width;
814
807
std::mutex *mutexLock;
815
- I->sycl_get_cm_buffer_params_index_ptr (surf_ind, &WriteBase, &width,
816
- &mutexLock);
817
- std::unique_lock<std::mutex> lock (*mutexLock);
808
+ I->sycl_get_cm_buffer_params_ptr (surf_ind, &WriteBase, &width, &mutexLock);
809
+ std::lock_guard<std::mutex> lock (*mutexLock);
818
810
}
819
811
820
812
WriteBase += global_offset;
@@ -931,10 +923,10 @@ __esimd_media_ld(TACC handle, unsigned x, unsigned y)
931
923
assert ((handle != __ESIMD_NS::detail::SLM_BTI) &&
932
924
" __esimd_media_ld cannot access SLM" );
933
925
934
- sycl::detail::getESIMDDeviceInterface ()->sycl_get_cm_image_params_index_ptr (
926
+ sycl::detail::getESIMDDeviceInterface ()->sycl_get_cm_image_params_ptr (
935
927
handle, &readBase, &imgWidth, &imgHeight, &bpp, &mutexLock);
936
928
937
- std::unique_lock <std::mutex> lock (*mutexLock);
929
+ std::lock_guard <std::mutex> lock (*mutexLock);
938
930
939
931
int x_pos_a, y_pos_a, offset, index;
940
932
@@ -1061,8 +1053,8 @@ __ESIMD_INTRIN void __esimd_media_st(TACC handle, unsigned x, unsigned y,
1061
1053
assert ((handle != __ESIMD_NS::detail::SLM_BTI) &&
1062
1054
" __esimd_media_ld cannot access SLM" );
1063
1055
1064
- I->sycl_get_cm_image_params_index_ptr (handle, &writeBase, &imgWidth,
1065
- &imgHeight, &bpp, &mutexLock);
1056
+ I->sycl_get_cm_image_params_ptr (handle, &writeBase, &imgWidth, &imgHeight ,
1057
+ &bpp, &mutexLock);
1066
1058
1067
1059
int x_pos_a, y_pos_a, offset;
1068
1060
@@ -1072,7 +1064,7 @@ __ESIMD_INTRIN void __esimd_media_st(TACC handle, unsigned x, unsigned y,
1072
1064
// TODO : Remove intermediate 'out' matrix
1073
1065
std::vector<std::vector<Ty>> out (M, std::vector<Ty>(N));
1074
1066
1075
- std::unique_lock <std::mutex> lock (*mutexLock);
1067
+ std::lock_guard <std::mutex> lock (*mutexLock);
1076
1068
1077
1069
for (int i = 0 , k = 0 ; i < M; i++) {
1078
1070
for (int j = 0 ; j < N; j++) {
0 commit comments