File tree Expand file tree Collapse file tree 3 files changed +3
-0
lines changed Expand file tree Collapse file tree 3 files changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ struct Type {
8888 virtual ~Type () {}
8989 virtual ScalarType scalarType () = 0;
9090 virtual Backend backend () = 0;
91+ virtual bool isCuda () = 0;
9192 virtual bool isSparse () = 0;
9293 virtual bool isDistributed () = 0;
9394 static void registerAll (Context * context);
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ ScalarType ${Type}::scalarType() {
1919Backend ${Type}::backend() {
2020 return Backend::${Backend};
2121}
22+ bool ${Type}::isCuda() { return backend () == kCUDA ; }
2223bool ${Type}::isSparse() { return false ; }
2324bool ${Type}::isDistributed() { return false ; }
2425
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ struct ${Type} : public Type {
1010 explicit ${Type}(Context* context);
1111 virtual ScalarType scalarType () override ;
1212 virtual Backend backend () override ;
13+ virtual bool isCuda () override ;
1314 virtual bool isSparse () override ;
1415 virtual bool isDistributed () override ;
1516 virtual std::unique_ptr<Storage> storage () override ;
You can’t perform that action at this time.
0 commit comments