-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CMDBUF] Fix incorrect handling of shared local mem args in CUDA/HIP
- Fix handling of local mem args in CUDA/HIP - Add conformance tests which check updating local memory args and work size - Change argSize in ur_exp_command_buffer_update_value_arg_desc_t to be size_t in line with urKernelSetArg
- Loading branch information
Showing
9 changed files
with
534 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (C) 2024 Intel Corporation | ||
// Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See LICENSE.TXT | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
#include <sycl/sycl.hpp> | ||
|
||
int main() { | ||
size_t array_size = 16; | ||
size_t local_size = 4; | ||
sycl::queue sycl_queue; | ||
uint32_t *X = sycl::malloc_shared<uint32_t>(array_size, sycl_queue); | ||
uint32_t *Y = sycl::malloc_shared<uint32_t>(array_size, sycl_queue); | ||
uint32_t *Z = sycl::malloc_shared<uint32_t>(array_size, sycl_queue); | ||
uint32_t A = 42; | ||
|
||
sycl_queue.submit([&](sycl::handler &cgh) { | ||
sycl::local_accessor<uint32_t, 1> local_mem(local_size, cgh); | ||
cgh.parallel_for<class saxpy_usm_local_mem>( | ||
sycl::nd_range<1>{{array_size}, {local_size}}, | ||
[=](sycl::nd_item<1> itemId) { | ||
auto i = itemId.get_global_linear_id(); | ||
auto local_id = itemId.get_local_linear_id(); | ||
local_mem[local_id] = i; | ||
Z[i] = A * X[i] + Y[i] + local_mem[local_id] + | ||
itemId.get_local_range(0); | ||
}); | ||
}); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.