update after ojzm

This commit is contained in:
TPP-G6
2026-03-14 10:12:22 +08:00
parent aa781a7a2a
commit 88c8b8fa01
7 changed files with 247 additions and 15 deletions
+33
View File
@@ -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!")