Skip to content

Commit

Permalink
[SYCLomatic] Support migration of 3 runtime Surface APIs.
Browse files Browse the repository at this point in the history
Signed-off-by: Tang, Jiajun jiajun.tang@intel.com
  • Loading branch information
tangjj11 committed Oct 16, 2024
1 parent 26d5414 commit 0dd7b35
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion clang/runtime/dpct-rt/include/dpct/bindless_images.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ inline void unmap_resources(int count, external_mem_wrapper **handles,
/// \param [in] q The queue where the image creation be executed.
/// \returns The sampled image handle of created bindless image.
static inline sycl::ext::oneapi::experimental::sampled_image_handle
create_bindless_image(image_data data, sampling_info info,
create_bindless_image(image_data data, sampling_info info = {},
sycl::queue q = get_default_queue()) {
auto samp = sycl::ext::oneapi::experimental::bindless_image_sampler(
info.get_addressing_mode(), info.get_coordinate_normalization_mode(),
Expand Down
14 changes: 14 additions & 0 deletions clang/test/dpct/texture/surface_object_bindless_image.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// RUN: dpct --format-range=none --use-experimental-features=bindless_images -out-root %T/texture/surface_object_bindless_image %s --cuda-include-path="%cuda-path/include" -- -x cuda --cuda-host-only -std=c++14
// RUN: FileCheck --input-file %T/texture/surface_object_bindless_image/surface_object_bindless_image.dp.cpp --match-full-lines %s
// RUN: %if build_lit %{icpx -c -fsycl %T/texture/surface_object_bindless_image/surface_object_bindless_image.dp.cpp -o %T/texture/surface_object_bindless_image/surface_object_bindless_image.dp.o %}

int main() {
cudaSurfaceObject_t surf;
cudaResourceDesc resDesc;
// CHECK: surf = dpct::experimental::create_bindless_image(resDesc);
cudaCreateSurfaceObject(&surf, &resDesc);
// CHECK: dpct::experimental::destroy_bindless_image(surf, q_ct1);
cudaDestroySurfaceObject(surf);
// CHECK: resDesc = dpct::experimental::get_data(surf);
cudaGetSurfaceObjectResourceDesc(&resDesc, surf);
}

0 comments on commit 0dd7b35

Please sign in to comment.