Esempio n. 1
0
 def _capture_showerror_for_last_julia_exception(self):
     msg = self.api.jl_eval_string(u"""
     try
         rethrow()
     catch ex
         sprint(showerror, ex, catch_backtrace())
     end""".encode('utf-8'))
     return char_p(msg).value.decode("utf-8")
Esempio n. 2
0
 def _capture_showerror_for_last_julia_exception(self):
     msg = self.api.jl_eval_string(u"""
     try
         rethrow()
     catch ex
         sprint(showerror, ex, catch_backtrace())
     end""".encode('utf-8'))
     return char_p(msg).value.decode("utf-8")
Esempio n. 3
0
def BuildProgram(program, devices, options=None):
    if options is not None:
        options = char_p(options.encode('utf-8'))

    num_devices = len(devices)
    dev_array = (device * num_devices)()
    for i, dev in enumerate(devices):
        dev_array[i] = dev
    lib_BuildProgram(program, num_devices, dev_array, options, None, None)
Esempio n. 4
0
 def _typeof_julia_exception_in_transit(self):
     exception = void_p.in_dll(self.api, 'jl_exception_in_transit')
     msg = self.api.jl_typeof_str(exception)
     return char_p(msg).value
Esempio n. 5
0
 def _typeof_julia_exception_in_transit(self):
     exception = void_p.in_dll(self.api, 'jl_exception_in_transit')
     msg = self.api.jl_typeof_str(exception)
     return char_p(msg).value
Esempio n. 6
0
 def _unwrap_exception(self, jl_exc):
     exception = void_p.in_dll(self.api, 'jl_exception_in_transit')
     msg = self.api.jl_typeof_str(exception)
     return char_p(msg).value
Esempio n. 7
0
def CreateProgramWithSource(context, source):
    source = source.encode()
    return lib_CreateProgramWithSource(context, 1, char_p(source), None,
                                       byref(ERROR()))