update after ojzm
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import pyopencl as cl
|
||||
|
||||
# Get all platforms
|
||||
platforms = cl.get_platforms()
|
||||
if not platforms:
|
||||
raise RuntimeError("No OpenCL platforms found")
|
||||
|
||||
# Use the first platform (rusticl in your case)
|
||||
platform = platforms[0]
|
||||
print("Using platform:", platform.name)
|
||||
|
||||
# Get devices for that platform
|
||||
devices = platform.get_devices()
|
||||
if not devices:
|
||||
raise RuntimeError("No devices found on platform")
|
||||
|
||||
for platform in cl.get_platforms():
|
||||
for device in platform.get_devices():
|
||||
print("Device:", device.name)
|
||||
# if device.type & cl.device_type.GPU == 0:
|
||||
# print("Skipping non-GPU device:", device.name)
|
||||
|
||||
# Use the first device (your Adreno GPU)
|
||||
device = devices[0]
|
||||
print("Using device:", device.name)
|
||||
|
||||
# Create a context with that device
|
||||
ctx = cl.Context([device])
|
||||
|
||||
# Create a command queue
|
||||
queue = cl.CommandQueue(ctx)
|
||||
|
||||
print("Context and command queue created successfully!")
|
||||
Reference in New Issue
Block a user