File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,3 +16,7 @@ pub mod platform;
1616pub mod queue;
1717pub mod range;
1818pub mod usm;
19+
20+ mod private {
21+ pub trait Sealed { }
22+ }
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ use oneapi_rs_sys::types;
1111use crate :: {
1212 event:: Event ,
1313 kernel:: { Kernel , KernelArgumentList } ,
14+ private:: Sealed ,
1415 queue:: Queue ,
1516} ;
1617
@@ -38,7 +39,7 @@ impl<const DIMENSIONS: usize> NdRange<DIMENSIONS> {
3839}
3940
4041/// [`NdRange`] types which are limited to 1, 2 or 3 dimensions.
41- pub trait ValidDimension {
42+ pub trait ValidDimension : Sealed {
4243 unsafe fn launch < const ARGC : usize > (
4344 & self ,
4445 queue : & mut Queue ,
@@ -47,6 +48,7 @@ pub trait ValidDimension {
4748 ) -> Event ;
4849}
4950
51+ impl Sealed for NdRange < 1 > { }
5052impl ValidDimension for NdRange < 1 > {
5153 unsafe fn launch < const ARGC : usize > (
5254 & self ,
@@ -71,6 +73,7 @@ impl ValidDimension for NdRange<1> {
7173 }
7274}
7375
76+ impl Sealed for NdRange < 2 > { }
7477impl ValidDimension for NdRange < 2 > {
7578 unsafe fn launch < const ARGC : usize > (
7679 & self ,
@@ -95,6 +98,7 @@ impl ValidDimension for NdRange<2> {
9598 }
9699}
97100
101+ impl Sealed for NdRange < 3 > { }
98102impl ValidDimension for NdRange < 3 > {
99103 unsafe fn launch < const ARGC : usize > (
100104 & self ,
You can’t perform that action at this time.
0 commit comments