Skip to content

Release/0.12.2.0 #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions cbits/stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@ cudaError_t cudaConfigureCall_simple(unsigned int gridX, unsigned int gridY, uns
}
#endif

CUresult cuTexRefSetAddress2D_simple(CUtexref tex, CUarray_format format, unsigned int numChannels, CUdeviceptr dptr, size_t width, size_t height, size_t pitch)
{
CUDA_ARRAY_DESCRIPTOR desc;
desc.Format = format;
desc.NumChannels = numChannels;
desc.Width = width;
desc.Height = height;

return cuTexRefSetAddress2D(tex, &desc, dptr, pitch);
}

CUresult cuMemcpy2DHtoD(CUdeviceptr dstDevice, unsigned int dstPitch, unsigned int dstXInBytes, unsigned int dstY, void* srcHost, unsigned int srcPitch, unsigned int srcXInBytes, unsigned int srcY, unsigned int widthInBytes, unsigned int height)
{
CUDA_MEMCPY2D desc;
Expand Down Expand Up @@ -284,11 +273,6 @@ CUresult CUDAAPI cuMemsetD32(CUdeviceptr dstDevice, unsigned int ui, size_t N)
{
return cuMemsetD32_v2(dstDevice, ui, N);
}

CUresult CUDAAPI cuTexRefSetAddress(size_t *ByteOffset, CUtexref hTexRef, CUdeviceptr dptr, size_t bytes)
{
return cuTexRefSetAddress_v2(ByteOffset, hTexRef, dptr, bytes);
}
#endif

#if CUDA_VERSION >= 4000
Expand Down
4 changes: 1 addition & 3 deletions cuda.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: 1.24

Name: cuda
Version: 0.11.0.1
Version: 0.12.2.0
Synopsis: FFI binding to the CUDA interface for programming NVIDIA GPUs
Description:
The CUDA library provides a direct, general purpose C-like SPMD programming
Expand Down Expand Up @@ -121,7 +121,6 @@ Library
Foreign.CUDA.Driver.Module.Query
Foreign.CUDA.Driver.Profiler
Foreign.CUDA.Driver.Stream
Foreign.CUDA.Driver.Texture
Foreign.CUDA.Driver.Unified
Foreign.CUDA.Driver.Utils

Expand All @@ -133,7 +132,6 @@ Library
Foreign.CUDA.Runtime.Exec
Foreign.CUDA.Runtime.Marshal
Foreign.CUDA.Runtime.Stream
Foreign.CUDA.Runtime.Texture
Foreign.CUDA.Runtime.Utils

-- Extras
Expand Down
10 changes: 4 additions & 6 deletions src/Foreign/CUDA/Driver/Graph/Capture.chs
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,15 @@ status = requireSDK 'status 10.0
--
-- @since 0.10.1.0
--
#if CUDA_VERSION < 10010
info :: Stream -> IO (Status, Int64)
info = requireSDK 'info 10.1
#else
{# fun unsafe cuStreamGetCaptureInfo as info
{# fun unsafe cuStreamGetCaptureInfo_v2 as info
{ useStream `Stream'
, alloca- `Status' peekEnum*
, alloca- `Int64' peekIntConv*
, alloca- `Graph'
, alloca- `Node'
, alloca- `CSize'
}
-> `()' checkStatus*- #}
#endif


-- | Set the stream capture interaction mode for this thread. Return the previous value.
Expand Down
23 changes: 1 addition & 22 deletions src/Foreign/CUDA/Driver/Module/Query.chs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
module Foreign.CUDA.Driver.Module.Query (

-- ** Querying module inhabitants
getFun, getPtr, getTex,
getFun, getPtr,

) where

Expand All @@ -28,7 +28,6 @@ import Foreign.CUDA.Driver.Error
import Foreign.CUDA.Driver.Exec
import Foreign.CUDA.Driver.Marshal ( peekDeviceHandle )
import Foreign.CUDA.Driver.Module.Base
import Foreign.CUDA.Driver.Texture
import Foreign.CUDA.Internal.C2HS
import Foreign.CUDA.Ptr

Expand Down Expand Up @@ -92,26 +91,6 @@ getPtr !mdl !name = do
-> `Status' cToEnum #}


-- |
-- Return a handle to a texture reference. This texture reference handle
-- should not be destroyed, as the texture will be destroyed automatically
-- when the module is unloaded.
--
-- <http://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__MODULE.html#group__CUDA__MODULE_1g9607dcbf911c16420d5264273f2b5608>
--
{-# INLINEABLE getTex #-}
getTex :: Module -> ShortByteString -> IO Texture
getTex !mdl !name = resultIfFound "texture" name =<< cuModuleGetTexRef mdl name

{-# INLINE cuModuleGetTexRef #-}
{# fun unsafe cuModuleGetTexRef
{ alloca- `Texture' peekTex*
, useModule `Module'
, useAsCString* `ShortByteString'
}
-> `Status' cToEnum #}


--------------------------------------------------------------------------------
-- Internal
--------------------------------------------------------------------------------
Expand Down
24 changes: 12 additions & 12 deletions src/Foreign/CUDA/Driver/Stream.chs
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,10 @@ write32 :: DevicePtr Word32 -> Word32 -> Stream -> [StreamWriteFlag] -> IO ()
#if CUDA_VERSION < 8000
write32 _ _ _ _ = requireSDK 'write32 8.0
#else
write32 ptr val stream flags = nothingIfOk =<< cuStreamWriteValue32 stream ptr val flags
write32 ptr val stream flags = nothingIfOk =<< cuStreamWriteValue32_v2 stream ptr val flags

{-# INLINE cuStreamWriteValue32 #-}
{# fun unsafe cuStreamWriteValue32
{-# INLINE cuStreamWriteValue32_v2 #-}
{# fun unsafe cuStreamWriteValue32_v2
{ useStream `Stream'
, useDeviceHandle `DevicePtr Word32'
, `Word32'
Expand All @@ -348,10 +348,10 @@ write64 :: DevicePtr Word64 -> Word64 -> Stream -> [StreamWriteFlag] -> IO ()
#if CUDA_VERSION < 9000
write64 _ _ _ _ = requireSDK 'write64 9.0
#else
write64 ptr val stream flags = nothingIfOk =<< cuStreamWriteValue64 stream ptr val flags
write64 ptr val stream flags = nothingIfOk =<< cuStreamWriteValue64_v2 stream ptr val flags

{-# INLINE cuStreamWriteValue64 #-}
{# fun unsafe cuStreamWriteValue64
{-# INLINE cuStreamWriteValue64_v2 #-}
{# fun unsafe cuStreamWriteValue64_v2
{ useStream `Stream'
, useDeviceHandle `DevicePtr Word64'
, `Word64'
Expand Down Expand Up @@ -385,10 +385,10 @@ wait32 :: DevicePtr Word32 -> Word32 -> Stream -> [StreamWaitFlag] -> IO ()
#if CUDA_VERSION < 8000
wait32 _ _ _ _ = requireSDK 'wait32 8.0
#else
wait32 ptr val stream flags = nothingIfOk =<< cuStreamWaitValue32 stream ptr val flags
wait32 ptr val stream flags = nothingIfOk =<< cuStreamWaitValue32_v2 stream ptr val flags

{-# INLINE cuStreamWaitValue32 #-}
{# fun unsafe cuStreamWaitValue32
{-# INLINE cuStreamWaitValue32_v2 #-}
{# fun unsafe cuStreamWaitValue32_v2
{ useStream `Stream'
, useDeviceHandle `DevicePtr Word32'
, `Word32'
Expand All @@ -401,10 +401,10 @@ wait64 :: DevicePtr Word64 -> Word64 -> Stream -> [StreamWaitFlag] -> IO ()
#if CUDA_VERSION < 9000
wait64 _ _ _ _ = requireSDK 'wait64 9.0
#else
wait64 ptr val stream flags = nothingIfOk =<< cuStreamWaitValue64 stream ptr val flags
wait64 ptr val stream flags = nothingIfOk =<< cuStreamWaitValue64_v2 stream ptr val flags

{-# INLINE cuStreamWaitValue64 #-}
{# fun unsafe cuStreamWaitValue64
{-# INLINE cuStreamWaitValue64_v2 #-}
{# fun unsafe cuStreamWaitValue64_v2
{ useStream `Stream'
, useDeviceHandle `DevicePtr Word64'
, `Word64'
Expand Down
Loading