<commit_before><commit_msg>Test: wrapper for multi-dimensional arrays?<commit_after>{-# LANGUAGE ForeignFunctionInterface, TypeFamilies #-}
--------------------------------------------------------------------------------
-- |
-- Module    : Foreign.CUDA.Array
-- Copyright : (c) 2009 <NAME>
-- License   : BSD
--
-- Multi-dimensional arrays for CUDA devices
--
--------------------------------------------------------------------------------

module Foreign.CUDA.Array
  (
  )
  where

import Foreign.CUDA.Internal.C2HS


-- |
-- Multi-dimensional array for the GPU. If the device and host memory spaces are
-- discrete, the data will be transferred as necessary.
--
data DeviceArray d t = DeviceArray
  {
    aShape :: Shape d,                  -- ^ Dimensions of the data
    aSize  :: Int64,                    -- ^ Size of the data in bytes
    aPtr   :: ForeignPtr t              -- ^ Location of the data
  }


-- |
-- The shape of an array gives the number of elements in each dimension
--

-- data Shape = Nil ()
--            | D1 Int64
--            | D2 (Int64,Int64)
--            | D3 (Int64,Int64,Int64)
-- 
type family   Shape d
type instance Shape ()                  = ()
type instance Shape Int64               = Int64
type instance Shape (Int64,Int64)       = (Int64,Int64)
type instance Shape (Int64,Int64,Int64) = (Int64,Int64,Int64)

{'fraction_non_alphanumeric': 0.21623616236162363, 'fraction_numerical': 0.03394833948339483, 'mean_word_length': 1.469945355191257, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5486349', 'n_tokens_mistral': 398, 'n_tokens_neox': 359, 'n_words': 118}