error.py 627 Bytes
Newer Older
dugupeiwen's avatar
dugupeiwen committed
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
26
27
28
29
30
class HsaDriverError(Exception):
    pass


class HsaSupportError(ImportError):
    pass


class HsaApiError(HsaDriverError):
    def __init__(self, code, msg):
        self.code = code
        super(HsaApiError, self).__init__(msg)


class HsaWarning(UserWarning):
    pass


class HsaKernelLaunchError(HsaDriverError):
    pass


class HsaContextMismatchError(HsaDriverError):
    def __init__(self, expect, got):
        fmt = ("device array is associated with a different "
               "context: expect {0} but got {1}")
        msg = fmt.format(expect, got)
        super(HsaContextMismatchError, self).__init__(msg)