Skip to content

Commit 7d8745e

Browse files
committed
Add sampled_image constructors with AllocatorT
1 parent 5e2791f commit 7d8745e

2 files changed

Lines changed: 162 additions & 0 deletions

File tree

adoc/chapters/programming_interface.adoc

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6591,6 +6591,36 @@ sampled_image(const void* hostPointer, image_format format,
65916591
[code]#sampled_image# via an instance of
65926592
[code]#property_list#.
65936593

6594+
a@
6595+
[source]
6596+
----
6597+
sampled_image(const void* hostPointer, image_format format,
6598+
image_sampler sampler,
6599+
const range<Dimensions>& rangeRef,
6600+
AllocatorT allocator,
6601+
const property_list& propList = {})
6602+
----
6603+
a@ Construct a SYCL [code]#sampled_image# instance with the
6604+
[code]#hostPointer# parameter provided. The [code]#sampled_image#
6605+
assumes exclusive access to this memory for the duration of its lifetime.
6606+
The host address is [code]#const#, so the host accesses must be
6607+
read-only. Since, the [code]#hostPointer# is [code]#const#, this image is only
6608+
initialized with this memory and there is no write after its
6609+
destruction.
6610+
The constructed SYCL [code]#sampled_image# will use the allocator
6611+
parameter provided when allocating memory on the host.
6612+
The element size of the constructed SYCL [code]#sampled_image#
6613+
will be derived from the [code]#format# parameter.
6614+
Accessors that read the constructed SYCL [code]#sampled_image# will
6615+
use the [code]#sampler# parameter to sample the image.
6616+
The range of the constructed SYCL [code]#sampled_image# is
6617+
specified by the [code]#rangeRef# parameter provided.
6618+
The pitch of the constructed SYCL [code]#sampled_image# will be
6619+
the default size determined by the <<sycl-runtime>>.
6620+
Zero or more properties can be provided to the constructed SYCL
6621+
[code]#sampled_image# via an instance of
6622+
[code]#property_list#.
6623+
65946624
a@
65956625
[source]
65966626
----
@@ -6621,13 +6651,83 @@ Zero or more properties can be provided to the constructed SYCL
66216651
[code]#sampled_image# via an instance of
66226652
[code]#property_list#.
66236653

6654+
a@
6655+
[source]
6656+
----
6657+
sampled_image(const void* hostPointer, image_format format,
6658+
image_sampler sampler,
6659+
const range<Dimensions>& rangeRef,
6660+
const range<Dimensions - 1>& pitch,
6661+
AllocatorT allocator,
6662+
const property_list& propList = {})
6663+
----
6664+
a@ Available only when: [code]#Dimensions > 1#.
6665+
6666+
Construct a SYCL [code]#sampled_image# instance with the [code]#hostPointer#
6667+
parameter provided. The [code]#sampled_image# assumes exclusive access to this
6668+
memory for the duration of its lifetime.
6669+
The host address is [code]#const#, so the host accesses must be
6670+
read-only. Since, the [code]#hostPointer# is [code]#const#, this
6671+
image is only initialized with this memory and there is no write after
6672+
destruction.
6673+
The constructed SYCL [code]#sampled_image# will use the allocator
6674+
parameter provided when allocating memory on the host.
6675+
The element size of the constructed SYCL [code]#sampled_image#
6676+
will be derived from the [code]#format# parameter.
6677+
Accessors that read the constructed SYCL [code]#sampled_image# will
6678+
use the [code]#sampler# parameter to sample the image.
6679+
The range of the constructed SYCL [code]#sampled_image# is
6680+
specified by the [code]#rangeRef# parameter provided.
6681+
The pitch of the constructed SYCL [code]#sampled_image# will be
6682+
the [code]#pitch# parameter provided.
6683+
Zero or more properties can be provided to the constructed SYCL
6684+
[code]#sampled_image# via an instance of
6685+
[code]#property_list#.
6686+
6687+
a@
6688+
[source]
6689+
----
6690+
sampled_image(std::shared_ptr<const void>& hostPointer,
6691+
image_format format,
6692+
image_sampler sampler,
6693+
const range<Dimensions>& rangeRef,
6694+
const property_list& propList = {})
6695+
----
6696+
a@ When [code]#hostPointer# is not empty, construct a SYCL
6697+
[code]#sampled_image# with the contents of its stored pointer. The
6698+
[code]#sampled_image# assumes exclusive access to this memory for the
6699+
duration of its lifetime. The [code]#sampled_image# also creates its
6700+
own internal copy of the [code]#shared_ptr# that shares ownership of the
6701+
[code]#hostData# memory, which means the application can safely release
6702+
ownership of this [code]#shared_ptr# when the constructor returns.
6703+
6704+
When [code]#hostPointer# is empty, construct a SYCL [code]#sampled_image#
6705+
with uninitialized memory.
6706+
6707+
The host address is [code]#const#, so the host accesses must be
6708+
read-only. Since, the [code]#hostPointer# is [code]#const#, this image is only
6709+
initialized with this memory and there is no write after its
6710+
destruction.
6711+
The element size of the constructed SYCL [code]#sampled_image#
6712+
will be derived from the [code]#format# parameter.
6713+
Accessors that read the constructed SYCL [code]#sampled_image# will
6714+
use the [code]#sampler# parameter to sample the image.
6715+
The range of the constructed SYCL [code]#sampled_image# is
6716+
specified by the [code]#rangeRef# parameter provided.
6717+
The pitch of the constructed SYCL [code]#sampled_image# will be
6718+
the default size determined by the <<sycl-runtime>>.
6719+
Zero or more properties can be provided to the constructed SYCL
6720+
[code]#sampled_image# via an instance of
6721+
[code]#property_list#.
6722+
66246723
a@
66256724
[source]
66266725
----
66276726
sampled_image(std::shared_ptr<const void>& hostPointer,
66286727
image_format format,
66296728
image_sampler sampler,
66306729
const range<Dimensions>& rangeRef,
6730+
AllocatorT allocator,
66316731
const property_list& propList = {})
66326732
----
66336733
a@ When [code]#hostPointer# is not empty, construct a SYCL
@@ -6645,6 +6745,8 @@ The host address is [code]#const#, so the host accesses must be
66456745
read-only. Since, the [code]#hostPointer# is [code]#const#, this image is only
66466746
initialized with this memory and there is no write after its
66476747
destruction.
6748+
The constructed SYCL [code]#sampled_image# will use the allocator
6749+
parameter provided when allocating memory on the host.
66486750
The element size of the constructed SYCL [code]#sampled_image#
66496751
will be derived from the [code]#format# parameter.
66506752
Accessors that read the constructed SYCL [code]#sampled_image# will
@@ -6694,6 +6796,46 @@ Zero or more properties can be provided to the constructed SYCL
66946796
[code]#sampled_image# via an instance of
66956797
[code]#property_list#.
66966798

6799+
a@
6800+
[source]
6801+
----
6802+
sampled_image(std::shared_ptr<const void>& hostPointer,
6803+
image_format format,
6804+
image_sampler sampler,
6805+
const range<Dimensions>& rangeRef,
6806+
const range<Dimensions - 1>& pitch,
6807+
AllocatorT allocator,
6808+
const property_list& propList = {})
6809+
----
6810+
a@ When [code]#hostPointer# is not empty, construct a SYCL
6811+
[code]#sampled_image# with the contents of its stored pointer. The
6812+
[code]#sampled_image# assumes exclusive access to this memory for the
6813+
duration of its lifetime. The [code]#sampled_image# also creates its
6814+
own internal copy of the [code]#shared_ptr# that shares ownership of the
6815+
[code]#hostData# memory, which means the application can safely release
6816+
ownership of this [code]#shared_ptr# when the constructor returns.
6817+
6818+
When [code]#hostPointer# is empty, construct a SYCL [code]#sampled_image#
6819+
with uninitialized memory.
6820+
6821+
The host address is [code]#const#, so the host accesses can be
6822+
read-only. Since, the [code]#hostPointer# is [code]#const#, this image is only
6823+
initialized with this memory and there is no write after its
6824+
destruction.
6825+
The constructed SYCL [code]#sampled_image# will use the allocator
6826+
parameter provided when allocating memory on the host.
6827+
The element size of the constructed SYCL [code]#sampled_image#
6828+
will be derived from the [code]#format# parameter.
6829+
Accessors that read the constructed SYCL [code]#sampled_image# will
6830+
use the [code]#sampler# parameter to sample the image.
6831+
The range of the constructed SYCL [code]#sampled_image# is
6832+
specified by the [code]#rangeRef# parameter provided.
6833+
The pitch of the constructed SYCL [code]#sampled_image# will be
6834+
the [code]#pitch# parameter provided.
6835+
Zero or more properties can be provided to the constructed SYCL
6836+
[code]#sampled_image# via an instance of
6837+
[code]#property_list#.
6838+
66976839
|====
66986840

66996841

adoc/headers/sampledImage.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,42 @@ class sampled_image {
2424
image_sampler sampler, const range<Dimensions>& rangeRef,
2525
const property_list& propList = {});
2626

27+
sampled_image(const void* hostPointer, image_format format,
28+
image_sampler sampler, const range<Dimensions>& rangeRef,
29+
AllocatorT allocator, const property_list& propList = {});
30+
2731
/* Available only when: Dimensions > 1 */
2832
sampled_image(const void* hostPointer, image_format format,
2933
image_sampler sampler, const range<Dimensions>& rangeRef,
3034
const range<Dimensions - 1>& pitch,
3135
const property_list& propList = {});
3236

37+
/* Available only when: Dimensions > 1 */
38+
sampled_image(const void* hostPointer, image_format format,
39+
image_sampler sampler, const range<Dimensions>& rangeRef,
40+
const range<Dimensions - 1>& pitch, AllocatorT allocator,
41+
const property_list& propList = {});
42+
3343
sampled_image(std::shared_ptr<const void>& hostPointer, image_format format,
3444
image_sampler sampler, const range<Dimensions>& rangeRef,
3545
const property_list& propList = {});
3646

47+
sampled_image(std::shared_ptr<const void>& hostPointer, image_format format,
48+
image_sampler sampler, const range<Dimensions>& rangeRef,
49+
AllocatorT allocator, const property_list& propList = {});
50+
3751
/* Available only when: Dimensions > 1 */
3852
sampled_image(std::shared_ptr<const void>& hostPointer, image_format format,
3953
image_sampler sampler, const range<Dimensions>& rangeRef,
4054
const range<Dimensions - 1>& pitch,
4155
const property_list& propList = {});
4256

57+
/* Available only when: Dimensions > 1 */
58+
sampled_image(std::shared_ptr<const void>& hostPointer, image_format format,
59+
image_sampler sampler, const range<Dimensions>& rangeRef,
60+
const range<Dimensions - 1>& pitch,
61+
AllocatorT allocator, const property_list& propList = {});
62+
4363
/* -- common interface members -- */
4464

4565
/* -- property interface members -- */

0 commit comments

Comments
 (0)