Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion dppl/ocldrv.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ def __new__(cls):
else:
_logger.warning("No GPU device")

cls._curr_device = DeviceEnv(cls._runtime[0][0].curr_env)
cls._curr_device = None

return obj

Expand All @@ -555,6 +555,10 @@ def has_gpu_device(self):

return Runtime._gpu_device is not None

def has_current_device(self):
''' Returns True if GPU or CPU context manager is being used.'''

return Runtime._curr_device is not None

def get_cpu_device(self):
''' Returns a cdata wrapper for the first available OpenCL
Expand Down Expand Up @@ -607,6 +611,7 @@ def dump(self):
runtime = Runtime()
has_cpu_device = runtime.has_cpu_device()
has_gpu_device = runtime.has_gpu_device()
has_current_device = runtime.has_current_device()

#------- Global Functions

Expand Down