Struct caffe2op_fallbackgpu::GPUFallbackOpEx
source · pub struct GPUFallbackOpEx<SkipOutputCopy> { /* private fields */ }
Expand description
| @brief A templated class to allow one to wrap | a CPU operator as a CUDA operator. | | This class can be used when one does not have | the CUDA implementation ready yet for an | operator. Essentially, what this op does is to | automatically deal with data copy for | you. Plausibly, this causes a lot of overhead | and is not optimal, so you should use this | operator mostly for quick prototyping purpose. | | All the input and output of the original | operator should be TensorCPU. | | Example usage: if you have a class MyMagicOp | that is CPU based, and you use the registration | code | | REGISTER_CPU_OPERATOR(MyMagic, MyMagicOp); | | to register the CPU side, you can create its | corresponding GPU operator (with performance | hits of course) via | | REGISTER_CUDA_OPERATOR(MyMagic, | GPUFallbackOp); | | Note that you will need to make sure that the | operators actually share the same name. | | Advanced usage: if you want to have some | specific outputs never copied, you can use the | SkipOutputCopy template argument to do that. | | For example, if MyMagic produces two outputs | and the first output is always going to live on | the CPU, you can do | | REGISTER_CUDA_OPERATOR(MyMagic, | GPUFallbackOpEx<SkipIndices<0>>);
Implementations§
Auto Trait Implementations§
impl<SkipOutputCopy> !RefUnwindSafe for GPUFallbackOpEx<SkipOutputCopy>
impl<SkipOutputCopy> !Send for GPUFallbackOpEx<SkipOutputCopy>
impl<SkipOutputCopy> !Sync for GPUFallbackOpEx<SkipOutputCopy>
impl<SkipOutputCopy> Unpin for GPUFallbackOpEx<SkipOutputCopy>where SkipOutputCopy: Unpin,
impl<SkipOutputCopy> !UnwindSafe for GPUFallbackOpEx<SkipOutputCopy>
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.