-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b3bf2d0
commit 704f176
Showing
5 changed files
with
70 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
from typing import TypeVar, Generic | ||
# Type Annotations | ||
|
||
T = TypeVar('T') | ||
|
||
class MLIRTypeAnnotation: | ||
def numba_str(): | ||
raise NotImplementedError("No numba type exists for MLIRTypeAnnotation") | ||
|
||
|
||
class Secret(Generic[T], MLIRTypeAnnotation): | ||
def numba_str(): | ||
raise NotImplementedError("No numba type exists for Secret") | ||
|
||
class Tensor(Generic[T], MLIRTypeAnnotation): | ||
def numba_str(): | ||
raise NotImplementedError("No numba type exists for Tensor") | ||
|
||
class F32(MLIRTypeAnnotation): | ||
def numba_str(): | ||
return "float32" | ||
|
||
class F64(MLIRTypeAnnotation): | ||
def numba_str(): | ||
return "float64" | ||
|
||
class I1(MLIRTypeAnnotation): | ||
def numba_str(): | ||
return "bool" | ||
|
||
class I4(MLIRTypeAnnotation): | ||
def numba_str(): | ||
return "int4" | ||
|
||
class I8(MLIRTypeAnnotation): | ||
def numba_str(): | ||
return "int8" | ||
|
||
|
||
class I16(MLIRTypeAnnotation): | ||
def numba_str(): | ||
return "int16" | ||
|
||
class I32(MLIRTypeAnnotation): | ||
def numba_str(): | ||
return "int32" | ||
class I64(MLIRTypeAnnotation): | ||
def numba_str(): | ||
return "int64" |