{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Data.Array.Accelerate.LLVM.PTX.Execute.Async (
Async, Stream, Event,
module Data.Array.Accelerate.LLVM.Execute.Async,
) where
import Data.Array.Accelerate.LLVM.Execute.Async hiding ( Async )
import qualified Data.Array.Accelerate.LLVM.Execute.Async as A
import Data.Array.Accelerate.LLVM.PTX.Target
import Data.Array.Accelerate.LLVM.PTX.Execute.Event ( Event )
import Data.Array.Accelerate.LLVM.PTX.Execute.Stream ( Stream )
import qualified Data.Array.Accelerate.LLVM.PTX.Execute.Event as Event
import qualified Data.Array.Accelerate.LLVM.PTX.Execute.Stream as Stream
import Control.Monad.State
type Async a = AsyncR PTX a
instance A.Async PTX where
type StreamR PTX = Stream
type EventR PTX = Event
{-# INLINEABLE fork #-}
fork =
Stream.create
{-# INLINEABLE join #-}
join stream =
liftIO $! Stream.destroy stream
{-# INLINEABLE checkpoint #-}
checkpoint stream =
Event.waypoint stream
{-# INLINEABLE after #-}
after stream event =
liftIO $! Event.after event stream
{-# INLINEABLE block #-}
block event =
liftIO $! Event.block event