diff options
author | Mikolaj Konarski <mikolaj.konarski@funktory.com> | 2025-05-13 17:30:44 +0200 |
---|---|---|
committer | Mikolaj Konarski <mikolaj.konarski@funktory.com> | 2025-05-13 17:30:44 +0200 |
commit | 0c993d875a7cb9bace8aea1ef6def200de6b7d51 (patch) | |
tree | 75e9a8c925a5bb4523d95f7f7e4a9794446b42a1 /ops | |
parent | ca78d92aa55e9ba8ad179ef42515e4e7b2b8155a (diff) |
Fix some of the warnings GHC 9.12.2 now produces
Diffstat (limited to 'ops')
-rw-r--r-- | ops/Data/Array/Strided/Arith/Internal.hs | 6 | ||||
-rw-r--r-- | ops/Data/Array/Strided/Array.hs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/ops/Data/Array/Strided/Arith/Internal.hs b/ops/Data/Array/Strided/Arith/Internal.hs index 95e5af2..5802573 100644 --- a/ops/Data/Array/Strided/Arith/Internal.hs +++ b/ops/Data/Array/Strided/Arith/Internal.hs @@ -53,7 +53,7 @@ debugShow (Array sh strides offset vec) = -- TODO: test all the cases of this thing with various input strides -liftOpEltwise1 :: (Storable a, Storable b) +liftOpEltwise1 :: Storable a => SNat n -> (Ptr a -> Ptr b) -> (Int64 -> Ptr b -> Ptr Int64 -> Ptr Int64 -> Ptr b -> IO ()) @@ -62,7 +62,7 @@ liftOpEltwise1 sn@SNat ptrconv cf_strided arr@(Array sh strides offset vec) | Just (blockOff, blockSz) <- stridesDense sh offset strides = if blockSz == 0 then Array sh (map (const 0) strides) 0 VS.empty - else let resvec = arrValues $ wrapUnary sn ptrconv cf_strided (Array [fromIntegral blockSz] [1] blockOff vec) + else let resvec = arrValues $ wrapUnary sn ptrconv cf_strided (Array [blockSz] [1] blockOff vec) in Array sh strides (offset - blockOff) resvec | otherwise = wrapUnary sn ptrconv cf_strided arr @@ -673,7 +673,7 @@ intWidBranchRedFull fsc fred32 fred64 sn | finiteBitSize (undefined :: i) == 64 = vectorRedFullOp @i @Int64 sn fsc fromIntegral castPtr fred64 | otherwise = error "Unsupported Int width" -intWidBranchExtr :: forall i n. (FiniteBits i, Storable i, Integral i) +intWidBranchExtr :: forall i n. (FiniteBits i, Storable i) => -- int32 (forall b. b ~ Int32 => Ptr Int64 -> Int64 -> Ptr Int64 -> Ptr Int64 -> Ptr b -> IO ()) -- ^ extremum kernel -- int64 diff --git a/ops/Data/Array/Strided/Array.hs b/ops/Data/Array/Strided/Array.hs index f757cd5..9280fe0 100644 --- a/ops/Data/Array/Strided/Array.hs +++ b/ops/Data/Array/Strided/Array.hs @@ -31,7 +31,7 @@ arrayFromVector sh vec shsize = product sh strides = NE.tail (NE.scanr (*) 1 sh) -arrayFromConstant :: (Storable a, KnownNat n) => [Int] -> a -> Array n a +arrayFromConstant :: Storable a => [Int] -> a -> Array n a arrayFromConstant sh x = Array sh (0 <$ sh) 0 (VS.singleton x) arrayRevDims :: [Bool] -> Array n a -> Array n a |