-
Notifications
You must be signed in to change notification settings - Fork 204
/
Copy patherrors.py
25 lines (20 loc) · 1 KB
/
errors.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
class Error(Exception):
"""Base class for exceptions in this module"""
def __init__(self):
Exception.__init__(self)
class TigreCudaCallError(Error):
"""Error list indexed against values in errors.hpp."""
def __init__(self, txt, error_index):
Error.__init__(self)
self.error_list = [
"GPU: Cuda error with exit code 1.",
"There are no available device(s) that support CUDA",
"GPU: One (or more) of your GPUs is being heavily used by another program (possibly graphics-based).\n" # noqa: E501
"Free the GPU to run TIGRE",
"GPU: Assertion Failed. Logic behind splitting flawed! Please tell: [email protected]", # noqa: E501
"GPU: Assertion Failed. Memory needed calculation broken! Please tell: [email protected]", # noqa: E501
]
self.error_index = error_index
self.txt = txt
def __str__(self):
return "\n".join([self.txt, self.error_list[self.error_index - 1]])