pub struct PlanPreference { /* private fields */ }Implementations§
Source§impl PlanPreference
impl PlanPreference
pub fn create_default(ctx: &Context) -> Result<Self>
Sourcepub fn create(
ctx: &Context,
algorithm: Algorithm,
jit_mode: JitMode,
) -> Result<Self>
pub fn create( ctx: &Context, algorithm: Algorithm, jit_mode: JitMode, ) -> Result<Self>
Creates a plan preference that limits the applicable kernels for a plan or operation.
The preference is tied to ctx and frees its cuTENSOR handle when dropped.
§Errors
Returns an error if the context is not initialized, cuTENSOR rejects the requested algorithm or JIT mode, or cuTENSOR does not return a valid handle.
Sourcepub unsafe fn from_raw(
handle: cutensorPlanPreference_t,
ctx: &Context,
) -> Result<Self>
pub unsafe fn from_raw( handle: cutensorPlanPreference_t, ctx: &Context, ) -> Result<Self>
Wraps an existing cuTENSOR plan-preference handle and takes ownership of it.
§Safety
handle must be a valid cuTENSOR plan-preference handle associated with
ctx. Ownership of handle is transferred to the returned preference,
and the handle must not be destroyed elsewhere after calling this
function.
pub fn set_autotune_mode(&mut self, mode: AutotuneMode) -> Result<()>
pub fn set_cache_mode(&mut self, mode: CacheMode) -> Result<()>
pub fn set_incremental_count(&mut self, count: i32) -> Result<()>
pub fn set_algorithm(&mut self, algorithm: Algorithm) -> Result<()>
pub fn set_kernel_rank(&mut self, rank: i32) -> Result<()>
pub fn set_jit_mode(&mut self, mode: JitMode) -> Result<()>
pub fn autotune_mode(&self) -> Result<AutotuneMode>
pub fn cache_mode(&self) -> Result<CacheMode>
pub fn incremental_count(&self) -> Result<i32>
pub fn algorithm(&self) -> Result<Algorithm>
pub fn kernel_rank(&self) -> Result<i32>
pub fn jit_mode(&self) -> Result<JitMode>
pub fn gpu_arch(&self) -> Result<u32>
Sourcepub fn set_gpu_arch(&mut self, gpu_arch: u32) -> Result<()>
pub fn set_gpu_arch(&mut self, gpu_arch: u32) -> Result<()>
Plans for a specific GPU architecture instead of the architecture associated with the context.
The value encodes the SM version as 10 * SM.major + SM.minor.
Currently only SM versions 80, 90 and 100 are supported.
§Errors
Returns an error if gpu_arch cannot be represented for cuTENSOR or if
cuTENSOR rejects the architecture value.
pub const fn as_raw(&self) -> cutensorPlanPreference_t
Sourcepub fn into_raw(self) -> cutensorPlanPreference_t
pub fn into_raw(self) -> cutensorPlanPreference_t
Consumes the preference and returns the raw cuTENSOR handle without destroying it.
The caller becomes responsible for eventually destroying the returned handle with cuTENSOR.