{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE TypeSynonymInstances #-}

module Data.SpirV.Enum.KernelEnqueueFlags where

import Data.Word (Word32)
import Foreign.Storable (Storable)

newtype KernelEnqueueFlags = KernelEnqueueFlags Word32
  deriving newtype (KernelEnqueueFlags -> KernelEnqueueFlags -> Bool
(KernelEnqueueFlags -> KernelEnqueueFlags -> Bool)
-> (KernelEnqueueFlags -> KernelEnqueueFlags -> Bool)
-> Eq KernelEnqueueFlags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: KernelEnqueueFlags -> KernelEnqueueFlags -> Bool
== :: KernelEnqueueFlags -> KernelEnqueueFlags -> Bool
$c/= :: KernelEnqueueFlags -> KernelEnqueueFlags -> Bool
/= :: KernelEnqueueFlags -> KernelEnqueueFlags -> Bool
Eq, Eq KernelEnqueueFlags
Eq KernelEnqueueFlags =>
(KernelEnqueueFlags -> KernelEnqueueFlags -> Ordering)
-> (KernelEnqueueFlags -> KernelEnqueueFlags -> Bool)
-> (KernelEnqueueFlags -> KernelEnqueueFlags -> Bool)
-> (KernelEnqueueFlags -> KernelEnqueueFlags -> Bool)
-> (KernelEnqueueFlags -> KernelEnqueueFlags -> Bool)
-> (KernelEnqueueFlags -> KernelEnqueueFlags -> KernelEnqueueFlags)
-> (KernelEnqueueFlags -> KernelEnqueueFlags -> KernelEnqueueFlags)
-> Ord KernelEnqueueFlags
KernelEnqueueFlags -> KernelEnqueueFlags -> Bool
KernelEnqueueFlags -> KernelEnqueueFlags -> Ordering
KernelEnqueueFlags -> KernelEnqueueFlags -> KernelEnqueueFlags
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: KernelEnqueueFlags -> KernelEnqueueFlags -> Ordering
compare :: KernelEnqueueFlags -> KernelEnqueueFlags -> Ordering
$c< :: KernelEnqueueFlags -> KernelEnqueueFlags -> Bool
< :: KernelEnqueueFlags -> KernelEnqueueFlags -> Bool
$c<= :: KernelEnqueueFlags -> KernelEnqueueFlags -> Bool
<= :: KernelEnqueueFlags -> KernelEnqueueFlags -> Bool
$c> :: KernelEnqueueFlags -> KernelEnqueueFlags -> Bool
> :: KernelEnqueueFlags -> KernelEnqueueFlags -> Bool
$c>= :: KernelEnqueueFlags -> KernelEnqueueFlags -> Bool
>= :: KernelEnqueueFlags -> KernelEnqueueFlags -> Bool
$cmax :: KernelEnqueueFlags -> KernelEnqueueFlags -> KernelEnqueueFlags
max :: KernelEnqueueFlags -> KernelEnqueueFlags -> KernelEnqueueFlags
$cmin :: KernelEnqueueFlags -> KernelEnqueueFlags -> KernelEnqueueFlags
min :: KernelEnqueueFlags -> KernelEnqueueFlags -> KernelEnqueueFlags
Ord, Ptr KernelEnqueueFlags -> IO KernelEnqueueFlags
Ptr KernelEnqueueFlags -> Int -> IO KernelEnqueueFlags
Ptr KernelEnqueueFlags -> Int -> KernelEnqueueFlags -> IO ()
Ptr KernelEnqueueFlags -> KernelEnqueueFlags -> IO ()
KernelEnqueueFlags -> Int
(KernelEnqueueFlags -> Int)
-> (KernelEnqueueFlags -> Int)
-> (Ptr KernelEnqueueFlags -> Int -> IO KernelEnqueueFlags)
-> (Ptr KernelEnqueueFlags -> Int -> KernelEnqueueFlags -> IO ())
-> (forall b. Ptr b -> Int -> IO KernelEnqueueFlags)
-> (forall b. Ptr b -> Int -> KernelEnqueueFlags -> IO ())
-> (Ptr KernelEnqueueFlags -> IO KernelEnqueueFlags)
-> (Ptr KernelEnqueueFlags -> KernelEnqueueFlags -> IO ())
-> Storable KernelEnqueueFlags
forall b. Ptr b -> Int -> IO KernelEnqueueFlags
forall b. Ptr b -> Int -> KernelEnqueueFlags -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
$csizeOf :: KernelEnqueueFlags -> Int
sizeOf :: KernelEnqueueFlags -> Int
$calignment :: KernelEnqueueFlags -> Int
alignment :: KernelEnqueueFlags -> Int
$cpeekElemOff :: Ptr KernelEnqueueFlags -> Int -> IO KernelEnqueueFlags
peekElemOff :: Ptr KernelEnqueueFlags -> Int -> IO KernelEnqueueFlags
$cpokeElemOff :: Ptr KernelEnqueueFlags -> Int -> KernelEnqueueFlags -> IO ()
pokeElemOff :: Ptr KernelEnqueueFlags -> Int -> KernelEnqueueFlags -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO KernelEnqueueFlags
peekByteOff :: forall b. Ptr b -> Int -> IO KernelEnqueueFlags
$cpokeByteOff :: forall b. Ptr b -> Int -> KernelEnqueueFlags -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> KernelEnqueueFlags -> IO ()
$cpeek :: Ptr KernelEnqueueFlags -> IO KernelEnqueueFlags
peek :: Ptr KernelEnqueueFlags -> IO KernelEnqueueFlags
$cpoke :: Ptr KernelEnqueueFlags -> KernelEnqueueFlags -> IO ()
poke :: Ptr KernelEnqueueFlags -> KernelEnqueueFlags -> IO ()
Storable)

instance Show KernelEnqueueFlags where
  showsPrec :: Int -> KernelEnqueueFlags -> ShowS
showsPrec Int
p (KernelEnqueueFlags Word32
v) = case Word32
v of
    Word32
0 -> String -> ShowS
showString String
"NoWait"
    Word32
1 -> String -> ShowS
showString String
"WaitKernel"
    Word32
2 -> String -> ShowS
showString String
"WaitWorkGroup"
    Word32
x -> Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> Int
10) (ShowS -> ShowS) -> ShowS -> ShowS
forall a b. (a -> b) -> a -> b
$ String -> ShowS
showString String
"KernelEnqueueFlags " ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Word32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec (Int
p Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
1) Word32
x

pattern NoWait :: KernelEnqueueFlags
pattern $mNoWait :: forall {r}. KernelEnqueueFlags -> ((# #) -> r) -> ((# #) -> r) -> r
$bNoWait :: KernelEnqueueFlags
NoWait = KernelEnqueueFlags 0

pattern WaitKernel :: KernelEnqueueFlags
pattern $mWaitKernel :: forall {r}. KernelEnqueueFlags -> ((# #) -> r) -> ((# #) -> r) -> r
$bWaitKernel :: KernelEnqueueFlags
WaitKernel = KernelEnqueueFlags 1

pattern WaitWorkGroup :: KernelEnqueueFlags
pattern $mWaitWorkGroup :: forall {r}. KernelEnqueueFlags -> ((# #) -> r) -> ((# #) -> r) -> r
$bWaitWorkGroup :: KernelEnqueueFlags
WaitWorkGroup = KernelEnqueueFlags 2