Skip to content

Commit 726bf42

Browse files
ProGTXprzemektmalon
authored andcommitted
[SYCL][Bindless] Compile on Windows
* Added missing `__SYCL_EXPORT` * Use fixed width `pi_uint64` instead of `unsigned long` * Added missing headers and forward declarations
1 parent d38b351 commit 726bf42

File tree

3 files changed

+39
-28
lines changed

3 files changed

+39
-28
lines changed

sycl/include/sycl/ext/oneapi/bindless_images.hpp

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ namespace oneapi {
2222
namespace experimental {
2323
/// Opaque unsampled image handle type.
2424
struct unsampled_image_handle {
25-
using raw_handle_type = unsigned long;
25+
using raw_handle_type = pi_uint64;
2626
raw_handle_type raw_handle;
2727
};
2828
/// Opaque sampled image handle type.
2929
struct sampled_image_handle {
30-
using raw_handle_type = unsigned long;
30+
using raw_handle_type = pi_uint64;
3131
raw_handle_type raw_handle;
3232
};
3333

@@ -530,9 +530,9 @@ __SYCL_EXPORT void *pitched_alloc_device(size_t *resultPitch,
530530
* @param syclContext The context in which we created our image memory handle
531531
* @return sycl range describing image's dimensions
532532
*/
533-
sycl::range<3> get_image_range(const image_mem_handle memHandle,
534-
const sycl::device &syclDevice,
535-
const sycl::context &syclContext);
533+
__SYCL_EXPORT sycl::range<3> get_image_range(const image_mem_handle memHandle,
534+
const sycl::device &syclDevice,
535+
const sycl::context &syclContext);
536536

537537
/**
538538
* @brief Get the range that describes the image's dimensions
@@ -541,8 +541,8 @@ sycl::range<3> get_image_range(const image_mem_handle memHandle,
541541
* @param syclQueue The queue in which we created our image memory handle
542542
* @return sycl range describing image's dimensions
543543
*/
544-
sycl::range<3> get_image_range(const image_mem_handle memHandle,
545-
const sycl::queue &syclQueue);
544+
__SYCL_EXPORT sycl::range<3> get_image_range(const image_mem_handle memHandle,
545+
const sycl::queue &syclQueue);
546546

547547
/**
548548
* @brief Get the channel type that describes the image memory
@@ -552,7 +552,7 @@ sycl::range<3> get_image_range(const image_mem_handle memHandle,
552552
* @param syclContext The context in which we created our image memory handle
553553
* @return sycl image channel type that describes the image
554554
*/
555-
sycl::image_channel_type
555+
__SYCL_EXPORT sycl::image_channel_type
556556
get_image_channel_type(const image_mem_handle memHandle,
557557
const sycl::device &syclDevice,
558558
const sycl::context &syclContext);
@@ -564,7 +564,7 @@ get_image_channel_type(const image_mem_handle memHandle,
564564
* @param syclQueue The queue in which we created our image memory handle
565565
* @return sycl image channel type that describes the image
566566
*/
567-
sycl::image_channel_type
567+
__SYCL_EXPORT sycl::image_channel_type
568568
get_image_channel_type(const image_mem_handle memHandle,
569569
const sycl::queue &syclQueue);
570570

@@ -576,9 +576,10 @@ get_image_channel_type(const image_mem_handle memHandle,
576576
* @param syclContext The context in which we created our image memory handle
577577
* @return The number of channels describing the image
578578
*/
579-
unsigned int get_image_num_channels(const image_mem_handle memHandle,
580-
const sycl::device &syclDevice,
581-
const sycl::context &syclContext);
579+
__SYCL_EXPORT unsigned int
580+
get_image_num_channels(const image_mem_handle memHandle,
581+
const sycl::device &syclDevice,
582+
const sycl::context &syclContext);
582583

583584
/**
584585
* @brief Get the number of channels that describes the image memory
@@ -587,8 +588,9 @@ unsigned int get_image_num_channels(const image_mem_handle memHandle,
587588
* @param syclQueue The queue in which we created our image memory handle
588589
* @return The number of channels describing the image
589590
*/
590-
unsigned int get_image_num_channels(const image_mem_handle memHandle,
591-
const sycl::queue &syclQueue);
591+
__SYCL_EXPORT unsigned int
592+
get_image_num_channels(const image_mem_handle memHandle,
593+
const sycl::queue &syclQueue);
592594

593595
namespace detail {
594596
// Get the number of coordinates

sycl/include/sycl/ext/oneapi/bindless_images_interop.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace experimental {
1616

1717
/// Opaque interop memory handle type
1818
struct interop_mem_handle {
19-
using raw_handle_type = unsigned long;
19+
using raw_handle_type = pi_uint64;
2020
raw_handle_type raw_handle;
2121
};
2222

@@ -39,7 +39,7 @@ template <typename HandleType> struct external_mem_descriptor {
3939

4040
/// Opaque interop semaphore handle type
4141
struct interop_semaphore_handle {
42-
using raw_handle_type = unsigned long;
42+
using raw_handle_type = pi_uint64;
4343
raw_handle_type raw_handle;
4444
};
4545

sycl/include/sycl/ext/oneapi/bindless_images_memory.hpp

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,17 @@
88

99
#pragma once
1010

11+
#include <sycl/context.hpp>
12+
#include <sycl/device.hpp>
1113
#include <sycl/ext/oneapi/bindless_images_descriptor.hpp>
14+
#include <sycl/image.hpp>
1215

1316
namespace sycl {
1417
__SYCL_INLINE_VER_NAMESPACE(_V1) {
18+
19+
// Forward declaration
20+
class queue;
21+
1522
namespace ext {
1623
namespace oneapi {
1724
namespace experimental {
@@ -28,9 +35,10 @@ class image_mem_impl {
2835
using raw_handle_type = image_mem_handle;
2936

3037
public:
31-
image_mem_impl(const image_descriptor &desc, const device &syclDevice,
32-
const context &syclContext);
33-
~image_mem_impl();
38+
__SYCL_EXPORT image_mem_impl(const image_descriptor &desc,
39+
const device &syclDevice,
40+
const context &syclContext);
41+
__SYCL_EXPORT ~image_mem_impl();
3442

3543
raw_handle_type get_handle() const { return handle; }
3644
const image_descriptor &get_descriptor() const { return descriptor; }
@@ -55,9 +63,9 @@ class image_mem {
5563
image_mem(const image_mem &) = default;
5664
image_mem(image_mem &&rhs) = default;
5765

58-
image_mem(const image_descriptor &desc, const device &syclDevice,
59-
const context &syclContext);
60-
image_mem(const image_descriptor &desc, const queue &syclQueue);
66+
__SYCL_EXPORT image_mem(const image_descriptor &desc,
67+
const device &syclDevice, const context &syclContext);
68+
__SYCL_EXPORT image_mem(const image_descriptor &desc, const queue &syclQueue);
6169
~image_mem() = default;
6270

6371
image_mem &operator=(const image_mem &) = default;
@@ -73,13 +81,14 @@ class image_mem {
7381
sycl::device get_device() const { return impl->get_device(); }
7482
sycl::context get_context() const { return impl->get_context(); }
7583

76-
sycl::range<3> get_range() const;
77-
sycl::image_channel_type get_channel_type() const;
78-
sycl::image_channel_order get_channel_order() const;
79-
unsigned int get_num_channels() const;
80-
image_type get_type() const;
84+
__SYCL_EXPORT sycl::range<3> get_range() const;
85+
__SYCL_EXPORT sycl::image_channel_type get_channel_type() const;
86+
__SYCL_EXPORT sycl::image_channel_order get_channel_order() const;
87+
__SYCL_EXPORT unsigned int get_num_channels() const;
88+
__SYCL_EXPORT image_type get_type() const;
8189

82-
raw_handle_type get_mip_level_mem_handle(const unsigned int level) const;
90+
__SYCL_EXPORT raw_handle_type
91+
__SYCL_EXPORT get_mip_level_mem_handle(const unsigned int level) const;
8392

8493
protected:
8594
std::shared_ptr<detail::image_mem_impl> impl;

0 commit comments

Comments
 (0)