Skip to content
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

[WIP] Supporting multiple gen-* directories. #39

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

lucasb-eyer
Copy link
Contributor

This is in preparation of #34, but doesn't include the discussed change yet. I decided to determine CUDA's version at import-time because I don't see why we should do so at build-time.

I recommend reviewing commit-by-commit as the first one just adds wrapped code and unnecessarily blows up the diff. The other three are more important.

I've marked this [WIP] because in my case, wrap_cuda.jl added the following to the top of gen_libcudart_h.jl, which I manually removed. (Because it causes failure due to __LONG_LONG_MAX__.) Any help in suppressing this is welcome, as I'm at a loss.

const unix = 1
const linux = 1
const MB_LEN_MAX = 16
const LLONG_MAX = __LONG_LONG_MAX__
const LLONG_MIN = -LLONG_MAX - 1
const ULLONG_MAX = LLONG_MAX * 2 + 1
const NR_OPEN = 1024
const NGROUPS_MAX = 65536
const ARG_MAX = 131072
const LINK_MAX = 127
const MAX_CANON = 255
const MAX_INPUT = 255
const NAME_MAX = 255
const PATH_MAX = 4096
const PIPE_BUF = 4096
const XATTR_NAME_MAX = 255
const XATTR_SIZE_MAX = 65536
const XATTR_LIST_MAX = 65536
const RTSIG_MAX = 32
const PTHREAD_KEYS_MAX = 1024
const PTHREAD_DESTRUCTOR_ITERATIONS = _POSIX_THREAD_DESTRUCTOR_ITERATIONS
const AIO_PRIO_DELTA_MAX = 20
const PTHREAD_STACK_MIN = 16384
const DELAYTIMER_MAX = 2147483647
const TTY_NAME_MAX = 32
const LOGIN_NAME_MAX = 256
const HOST_NAME_MAX = 64
const MQ_PRIO_MAX = 32768

# Skipping MacroDefinition: SEM_VALUE_MAX ( 2147483647

const LONG_MAX = __LONG_MAX__
const SSIZE_MAX = LONG_MAX
const BC_BASE_MAX = _POSIX2_BC_BASE_MAX
const BC_DIM_MAX = _POSIX2_BC_DIM_MAX
const BC_SCALE_MAX = _POSIX2_BC_SCALE_MAX
const BC_STRING_MAX = _POSIX2_BC_STRING_MAX
const COLL_WEIGHTS_MAX = 255
const EXPR_NEST_MAX = _POSIX2_EXPR_NEST_MAX
const LINE_MAX = _POSIX2_LINE_MAX
const CHARCLASS_NAME_MAX = 2048
const RE_DUP_MAX = 0x07ff
const CHAR_BIT = __CHAR_BIT__
const SCHAR_MAX = __SCHAR_MAX__
const SCHAR_MIN = -SCHAR_MAX - 1
const UCHAR_MAX = SCHAR_MAX * 2 + 1
const CHAR_MIN = SCHAR_MIN
const CHAR_MAX = SCHAR_MAX
const SHRT_MAX = __SHRT_MAX__
const SHRT_MIN = -SHRT_MAX - 1
const USHRT_MAX = SHRT_MAX * 2 + 1
const INT_MAX = __INT_MAX__
const INT_MIN = -INT_MAX - 1
const UINT_MAX = INT_MAX * 2 + 1
const LONG_MIN = -LONG_MAX - 1
const ULONG_MAX = LONG_MAX * 2 + 1

# Skipping MacroDefinition: NULL ( ( void * ) 0 )
# Skipping MacroDefinition: offsetof ( TYPE , MEMBER ) __builtin_offsetof ( TYPE , MEMBER )

The following is the output while wrapping. Note how it does state skipping limits.h which, on my system, seems to be the origin of most (but not all) of the above.

WRAPPING HEADER: /opt/cuda/include/driver_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   host_defines.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   limits.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   syslimits.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   limits.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   features.h
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _DEFAULT_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _DEFAULT_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _ATFILE_SOURCE
WARNING: Not wrapping Clang.cindex.InclusionDirective   stdc-predef.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   sys/cdefs.h
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _FEATURES_H
WARNING: Not wrapping Clang.cindex.InclusionDirective   bits/wordsize.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   gnu/stubs.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   gnu/stubs-64.h
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _GCC_LIMITS_H_
WARNING: Not wrapping Clang.cindex.InclusionDirective   bits/posix1_lim.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   bits/local_lim.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   linux/limits.h
WARNING: Not wrapping Clang.cindex.MacroInstantiation   NGROUPS_MAX
WARNING: Not wrapping Clang.cindex.InclusionDirective   bits/posix2_lim.h
WARNING: Not wrapping Clang.cindex.MacroInstantiation   MB_LEN_MAX
WARNING: Not wrapping Clang.cindex.InclusionDirective   stddef.h
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H_
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H_
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H_
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _BSD_WCHAR_T_
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDA_IPC_HANDLE_SIZE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDA_IPC_HANDLE_SIZE
WARNING: Skipping unnamed StructDecl
writing gen_libcudart.jl
WRAPPING HEADER: /opt/cuda/include/vector_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   builtin_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   device_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   host_defines.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   driver_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   host_defines.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   limits.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   syslimits.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   limits.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   features.h
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _DEFAULT_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _DEFAULT_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _ATFILE_SOURCE
WARNING: Not wrapping Clang.cindex.InclusionDirective   stdc-predef.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   sys/cdefs.h
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _FEATURES_H
WARNING: Not wrapping Clang.cindex.InclusionDirective   bits/wordsize.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   gnu/stubs.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   gnu/stubs-64.h
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _GCC_LIMITS_H_
WARNING: Not wrapping Clang.cindex.InclusionDirective   bits/posix1_lim.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   bits/local_lim.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   linux/limits.h
WARNING: Not wrapping Clang.cindex.MacroInstantiation   NGROUPS_MAX
WARNING: Not wrapping Clang.cindex.InclusionDirective   bits/posix2_lim.h
WARNING: Not wrapping Clang.cindex.MacroInstantiation   MB_LEN_MAX
WARNING: Not wrapping Clang.cindex.InclusionDirective   stddef.h
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H_
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H_
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H_
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _BSD_WCHAR_T_
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDA_IPC_HANDLE_SIZE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDA_IPC_HANDLE_SIZE
WARNING: Not wrapping Clang.cindex.InclusionDirective   surface_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   driver_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   texture_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   driver_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   vector_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   host_defines.h
WARNING: Skipping unnamed StructDecl
WARNING: Skipping struct: "char2" due to unsupported field: 
WARNING: Skipping struct: "uchar2" due to unsupported field: 
WARNING: Skipping struct: "char4" due to unsupported field: 
WARNING: Skipping struct: "uchar4" due to unsupported field: 
WARNING: Skipping struct: "short2" due to unsupported field: 
WARNING: Skipping struct: "ushort2" due to unsupported field: 
WARNING: Skipping struct: "short4" due to unsupported field: 
WARNING: Skipping struct: "ushort4" due to unsupported field: 
WARNING: Skipping struct: "int2" due to unsupported field: 
WARNING: Skipping struct: "uint2" due to unsupported field: 
WARNING: Skipping struct: "int4" due to unsupported field: 
WARNING: Skipping struct: "uint4" due to unsupported field: 
WARNING: Skipping struct: "long2" due to unsupported field: 
WARNING: Skipping struct: "ulong2" due to unsupported field: 
WARNING: Skipping struct: "long4" due to unsupported field: 
WARNING: Skipping struct: "ulong4" due to unsupported field: 
WARNING: Skipping struct: "float2" due to unsupported field: 
WARNING: Skipping struct: "float4" due to unsupported field: 
WARNING: Skipping struct: "longlong2" due to unsupported field: 
WARNING: Skipping struct: "ulonglong2" due to unsupported field: 
WARNING: Skipping struct: "longlong4" due to unsupported field: 
WARNING: Skipping struct: "ulonglong4" due to unsupported field: 
WARNING: Skipping struct: "double2" due to unsupported field: 
WARNING: Skipping struct: "double4" due to unsupported field: 
writing gen_libcudart.jl
WRAPPING HEADER: /opt/cuda/include/cuda_runtime_api.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   host_defines.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   builtin_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   device_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   host_defines.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   driver_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   host_defines.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   limits.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   syslimits.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   limits.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   features.h
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _DEFAULT_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _POSIX_C_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _DEFAULT_SOURCE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _ATFILE_SOURCE
WARNING: Not wrapping Clang.cindex.InclusionDirective   stdc-predef.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   sys/cdefs.h
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _FEATURES_H
WARNING: Not wrapping Clang.cindex.InclusionDirective   bits/wordsize.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   gnu/stubs.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   gnu/stubs-64.h
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _GCC_LIMITS_H_
WARNING: Not wrapping Clang.cindex.InclusionDirective   bits/posix1_lim.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   bits/local_lim.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   linux/limits.h
WARNING: Not wrapping Clang.cindex.MacroInstantiation   NGROUPS_MAX
WARNING: Not wrapping Clang.cindex.InclusionDirective   bits/posix2_lim.h
WARNING: Not wrapping Clang.cindex.MacroInstantiation   MB_LEN_MAX
WARNING: Not wrapping Clang.cindex.InclusionDirective   stddef.h
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H_
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H_
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H_
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _BSD_WCHAR_T_
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H
WARNING: Not wrapping Clang.cindex.MacroInstantiation   _STDDEF_H
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDA_IPC_HANDLE_SIZE
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDA_IPC_HANDLE_SIZE
WARNING: Not wrapping Clang.cindex.InclusionDirective   surface_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   driver_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   texture_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   driver_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   vector_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   builtin_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   device_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   driver_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   surface_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   texture_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   vector_types.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   host_defines.h
WARNING: Not wrapping Clang.cindex.InclusionDirective   cuda_device_runtime_api.h
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDART_CB
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDART_VERSION
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDART_VERSION
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDART_VERSION
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Not wrapping Clang.cindex.MacroInstantiation   CUDARTAPI
WARNING: Skipping unnamed StructDecl
WARNING: Skipping struct: "char2" due to unsupported field: 
WARNING: Skipping struct: "uchar2" due to unsupported field: 
WARNING: Skipping struct: "char4" due to unsupported field: 
WARNING: Skipping struct: "uchar4" due to unsupported field: 
WARNING: Skipping struct: "short2" due to unsupported field: 
WARNING: Skipping struct: "ushort2" due to unsupported field: 
WARNING: Skipping struct: "short4" due to unsupported field: 
WARNING: Skipping struct: "ushort4" due to unsupported field: 
WARNING: Skipping struct: "int2" due to unsupported field: 
WARNING: Skipping struct: "uint2" due to unsupported field: 
WARNING: Skipping struct: "int4" due to unsupported field: 
WARNING: Skipping struct: "uint4" due to unsupported field: 
WARNING: Skipping struct: "long2" due to unsupported field: 
WARNING: Skipping struct: "ulong2" due to unsupported field: 
WARNING: Skipping struct: "long4" due to unsupported field: 
WARNING: Skipping struct: "ulong4" due to unsupported field: 
WARNING: Skipping struct: "float2" due to unsupported field: 
WARNING: Skipping struct: "float4" due to unsupported field: 
WARNING: Skipping struct: "longlong2" due to unsupported field: 
WARNING: Skipping struct: "ulonglong2" due to unsupported field: 
WARNING: Skipping struct: "longlong4" due to unsupported field: 
WARNING: Skipping struct: "ulonglong4" due to unsupported field: 
WARNING: Skipping struct: "double2" due to unsupported field: 
WARNING: Skipping struct: "double4" due to unsupported field: 
writing gen_libcudart.jl

@timholy
Copy link
Contributor

timholy commented Oct 29, 2015

Sorry I didn't notice this when it came in. I have a grant due middle of next week; ping me if I don't get back to you shortly thereafter.

@lucasb-eyer
Copy link
Contributor Author

No worries, and good luck with the grant!

# Determine the version of the CUDArt library.
function cudart_version()
a = Cint[0]
ccall((:cudaRuntimeGetVersion,libcudart),UInt32,(Ptr{Cint},),a)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lucasb-eyer, I am on Arch Linux, CUDArt is found under /opt/cuda/lib64, but this line is returning an invalid version number for me (v0.0.0).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm on Arch too, actually. I hope to find some time this weekend and see if I can reproduce.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lucasb-eyer have you had the time to reproduce the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting this same behaviour on my laptop when using the on-board GPU. Does this happen to be the case for you? It's because in that case, cudaRuntimeGetVersion gives a bogous return value, 0x00000026 in my case.

How did you get here? Maybe I need to add a better error message somewhere?

Copy link

@juliohm juliohm Dec 9, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lucasb-eyer can I use the PRIME technology or do I need to set my NVIDIA as the primary card? Are you using proprietary or open source drivers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nouveau doesn't have CUDA support, thus proprietary drivers. Run optirun julia ... to make it possible to use the discrete GPU. Depending on your system, it may be somewhat finnicky and quite unstable.

@timholy
Copy link
Contributor

timholy commented Jan 8, 2016

Argh, forgot about this again.

IIUC, the only holdup is suppressing the "typedefs" at the beginning of the generated file? I haven't used Clang.jl in quite a while now, so I'm a bit rusty and nothing immediately comes to mind. Maybe file an issue over at Clang.jl?

However, I don't think it's a disaster to commit this with manual tweaks. As an alternative to deleting the problematic code, you could try defining something that prevents the failure---then the manual tweak would be in a small file and you can include a comment about why it's necessary.

@lucasb-eyer
Copy link
Contributor Author

I also forgot pinging you :-) Yes, your understanding is correct, I'll both try to workaround and ask at Clang.jl and then give an update here.

@vchuravy
Copy link
Contributor

vchuravy commented Mar 2, 2017

@lucasb-eyer is there still interest from your side to work on this? I am working on updating CUDAdrv and I would like to see this merged.

@vchuravy vchuravy added this to the v0.4 milestone Mar 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants