Permalink
Browse files

Command queue creation now respects the set of supported queue proper…

…ties by the device. This closes #8.
  • Loading branch information...
1 parent 77690cc commit f4f40030c957e8e9463f3ac4497ed563bd6cc6f8 @dybber dybber committed Dec 2, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 Data/Array/Accelerate/OpenCL/State.hs
@@ -179,7 +179,7 @@ initialise :: IO OpenCLState
initialise = do
(platform, devices) <- selectBestPlatform
context <- createContext devices [ContextPlatform platform] NoContextCallback
- queues <- mapM (flip (createCommandQueue context) [QueueOutOfOrderExecModeEnable]) devices
+ queues <- mapM (\dev -> queueProps dev >>= createCommandQueue context dev) devices
(knl, u) <- loadIndexFile
return $ OpenCLState
{ _unique = u
@@ -190,6 +190,11 @@ initialise = do
, _memoryTable = error "Memory table not initialized"
}
+queueProps :: DeviceID -> IO [CommandQueueProperties]
+queueProps dev = do
+ supported <- deviceQueueProperties dev
+ return $ intersect supported [QueueOutOfOrderExecModeEnable]
+
-- | Evaluate a OpenCL array computation under the standard global environment
--
evalOpenCL :: CIO a -> IO a

0 comments on commit f4f4003

Please sign in to comment.