File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 43
43
Explicitly use NumPy.ndarray as return type for creation functions
44
44
'''
45
45
46
+ __DPNP_OUTPUT_DPCTL_DEFAULT_SHARED__ = int (os .getenv ('DPNP_OUTPUT_DPCTL_DEFAULT_SHARED' , 0 ))
47
+ '''
48
+ Explicitly use SYCL shared memory parameter in DPCtl array constructor for creation functions
49
+ '''
50
+
46
51
__DPNP_DPCTL_AVAILABLE__ = False
47
52
'''
48
53
Availability of the DPCtl package in the environment
Original file line number Diff line number Diff line change @@ -69,7 +69,17 @@ def create_output_container(shape, type):
69
69
result = numpy .ndarray (shape , dtype = type )
70
70
elif config .__DPNP_DPCTL_AVAILABLE__ :
71
71
""" Create DPCTL array """
72
- result = dpctl .usm_ndarray (shape , dtype = numpy .dtype (type ).name )
72
+ if config .__DPNP_OUTPUT_DPCTL_DEFAULT_SHARED__ :
73
+ """
74
+ From DPCtrl documentation:
75
+ 'buffer can be strings ('device'|'shared'|'host' to allocate new memory)'
76
+ """
77
+ result = dpctl .usm_ndarray (shape , dtype = numpy .dtype (type ).name , buffer = 'shared' )
78
+ else :
79
+ """
80
+ Can't pass 'None' as buffer= parameter to allow DPCtrl uses it's default
81
+ """
82
+ result = dpctl .usm_ndarray (shape , dtype = numpy .dtype (type ).name )
73
83
else :
74
84
""" Create DPNP array """
75
85
result = dparray (shape , dtype = type )
You can’t perform that action at this time.
0 commit comments