File tree Expand file tree Collapse file tree
vortex-array/src/arrays/extension Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,7 +75,11 @@ impl ExtensionArray {
7575 ///
7676 /// Returns an error if the storage array in not compatible with the extension dtype.
7777 pub fn try_new ( ext_dtype : ExtDTypeRef , storage_array : ArrayRef ) -> VortexResult < Self > {
78- ext_dtype. validate_storage_array ( & storage_array) ?;
78+ if storage_array. is_host ( ) {
79+ ext_dtype. validate_storage_array ( & storage_array) ?;
80+ } else {
81+ eprintln ! ( "Unable to validate storage array on GPU" )
82+ }
7983
8084 // SAFETY: we validate that the inputs are valid above.
8185 Ok ( unsafe { Self :: new_unchecked ( ext_dtype, storage_array) } )
@@ -90,9 +94,15 @@ impl ExtensionArray {
9094 /// called successfully on this storage array.
9195 pub unsafe fn new_unchecked ( ext_dtype : ExtDTypeRef , storage_array : ArrayRef ) -> Self {
9296 #[ cfg( debug_assertions) ]
93- ext_dtype
94- . validate_storage_array ( & storage_array)
95- . vortex_expect ( "[Debug Assertion]: Invalid storage array for `ExtensionArray`" ) ;
97+ {
98+ if storage_array. is_host ( ) {
99+ ext_dtype
100+ . validate_storage_array ( & storage_array)
101+ . vortex_expect ( "[Debug Assertion]: Invalid storage array for `ExtensionArray`" ) ;
102+ } else {
103+ eprintln ! ( "Unable to validate storage array on GPU" )
104+ }
105+ }
96106
97107 // The dtype check is much cheaper than the storage validation, so we might as well do this.
98108 assert_eq ! (
You can’t perform that action at this time.
0 commit comments