Skip to content

Commit

Permalink
Merge pull request #7 from JuliaGPU/fbot/deps
Browse files Browse the repository at this point in the history
Fix deprecations
  • Loading branch information
MikeInnes authored Aug 27, 2017
2 parents af3af36 + 196b815 commit f37eb6d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
16 changes: 8 additions & 8 deletions src/CUDNN.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export cudnnLRNCrossChannelForward, cudnnLRNCrossChannelBackward, cudnnDivisiveN
import Base: unsafe_convert, conv2, strides

# This is missing from CUDArt:
type cudaStream; end
struct cudaStream; end
const cudaStream_t = Ptr{cudaStream}

# This is missing from cudnn.h:
Expand Down Expand Up @@ -87,12 +87,12 @@ juliaDataType(a)=(a==CUDNN_DATA_HALF ? Float16 :

### 1. DESCRIPTORS ##################################################

type TD; ptr; end
type FD; ptr; end
type CD; ptr; end
type PD; ptr; end
type LD; ptr; end
type AD; ptr; end
mutable struct TD; ptr; end
mutable struct FD; ptr; end
mutable struct CD; ptr; end
mutable struct PD; ptr; end
mutable struct LD; ptr; end
mutable struct AD; ptr; end

free(td::TD)=cudnnDestroyTensorDescriptor(td.ptr)
free(fd::FD)=cudnnDestroyFilterDescriptor(fd.ptr)
Expand Down Expand Up @@ -395,7 +395,7 @@ end
# conv2(x,w) in Julia performs 2-D convolution with padding equal to
# one less than the w dimensions.

Base.conv2{T}(src::CuArray{T}, filter::CuArray{T}, dest=nothing)=
Base.conv2(src::CuArray{T}, filter::CuArray{T}, dest=nothing) where {T}=
cudnnConvolutionForward(src, filter, dest; cd=CD(src; padding = (size(filter,1)-1, size(filter,2)-1)))

# n=h=w=1 for dest and c same as input. CUDNN seems to assume a
Expand Down
20 changes: 10 additions & 10 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const CUDNN_LRN_MIN_K = 1.0e-5
const CUDNN_LRN_MIN_BETA = 0.01
const CUDNN_BN_MIN_EPSILON = 1.0e-5

type cudnnContext
mutable struct cudnnContext
end

const cudnnHandle_t = Ptr{cudnnContext}
Expand All @@ -33,32 +33,32 @@ const CUDNN_STATUS_NOT_SUPPORTED = (UInt32)(9)
const CUDNN_STATUS_LICENSE_ERROR = (UInt32)(10)
# end enum cudnnStatus_t

type cudnnTensorStruct
mutable struct cudnnTensorStruct
end

const cudnnTensorDescriptor_t = Ptr{cudnnTensorStruct}

type cudnnConvolutionStruct
mutable struct cudnnConvolutionStruct
end

const cudnnConvolutionDescriptor_t = Ptr{cudnnConvolutionStruct}

type cudnnPoolingStruct
mutable struct cudnnPoolingStruct
end

const cudnnPoolingDescriptor_t = Ptr{cudnnPoolingStruct}

type cudnnFilterStruct
mutable struct cudnnFilterStruct
end

const cudnnFilterDescriptor_t = Ptr{cudnnFilterStruct}

type cudnnLRNStruct
mutable struct cudnnLRNStruct
end

const cudnnLRNDescriptor_t = Ptr{cudnnLRNStruct}

type cudnnActivationStruct
mutable struct cudnnActivationStruct
end

const cudnnActivationDescriptor_t = Ptr{cudnnActivationStruct}
Expand Down Expand Up @@ -115,7 +115,7 @@ const CUDNN_CONVOLUTION_FWD_ALGO_FFT = (UInt32)(4)
const CUDNN_CONVOLUTION_FWD_ALGO_FFT_TILING = (UInt32)(5)
# end enum cudnnConvolutionFwdAlgo_t

type cudnnConvolutionFwdAlgoPerf_t
mutable struct cudnnConvolutionFwdAlgoPerf_t
algo::cudnnConvolutionFwdAlgo_t
status::cudnnStatus_t
time::Cfloat
Expand All @@ -137,7 +137,7 @@ const CUDNN_CONVOLUTION_BWD_FILTER_ALGO_FFT = (UInt32)(2)
const CUDNN_CONVOLUTION_BWD_FILTER_ALGO_3 = (UInt32)(3)
# end enum cudnnConvolutionBwdFilterAlgo_t

type cudnnConvolutionBwdFilterAlgoPerf_t
mutable struct cudnnConvolutionBwdFilterAlgoPerf_t
algo::cudnnConvolutionBwdFilterAlgo_t
status::cudnnStatus_t
time::Cfloat
Expand All @@ -159,7 +159,7 @@ const CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT = (UInt32)(2)
const CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT_TILING = (UInt32)(3)
# end enum cudnnConvolutionBwdDataAlgo_t

type cudnnConvolutionBwdDataAlgoPerf_t
mutable struct cudnnConvolutionBwdDataAlgoPerf_t
algo::cudnnConvolutionBwdDataAlgo_t
status::cudnnStatus_t
time::Cfloat
Expand Down

0 comments on commit f37eb6d

Please sign in to comment.