From 3b03b9cbf62deccea3c9d9b1ad852b63e83fb0cd Mon Sep 17 00:00:00 2001 From: Third Party Date: Thu, 8 Dec 2016 15:48:49 +0100 Subject: [PATCH] Squashed 'thirdParty/cuda_memtest/' changes from 0e27280..6806362 6806362 Remove non-ascii chars 9bddbdf Merge pull request #9 from ComputationalRadiationPhysics/fix-travisCuda55Trusty cb23b31 Merge pull request #7 from ComputationalRadiationPhysics/fix-closeFiles 2ad4d88 Travis: Migrate to Trusty Image 13e215e Close File Handles (cppcheck) git-subtree-dir: thirdParty/cuda_memtest git-subtree-split: 680636204b751c3e16e196ee95dc254ffae737db --- .travis.yml | 43 ++++++++++++++++++++++++++++++++----------- cuda_memtest.h | 2 +- misc.cpp | 2 ++ ocl_memtest.cpp | 2 ++ tests.cu | 2 +- 5 files changed, 38 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index ae906433787..9726948ce78 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,34 +1,55 @@ language: cpp +sudo: required +dist: trusty + compiler: - gcc - clang +matrix: + allow_failures: + - compiler: clang + +addons: + apt: + #sources: + # - multiverse + packages: + - build-essential + - cmake-data + - cmake + - g++-4.8 + - gcc-4.8 + - nvidia-common + # - nvidia-cuda-toolkit + # - nvidia-cuda-dev + env: global: - INSTALL_DIR=~/mylibs - NVML_FILE=cuda_346.46_gdk_linux.run - NVML_LINK=http://developer.download.nvidia.com/compute/cuda/7_0/Prod/local_installers/ matrix: - - USE_NVML=1 - - USE_NVML=0 + - USE_NVML=1 USE_SM=sm_10 + - USE_NVML=0 USE_SM=sm_20 script: - mkdir build_tmp && cd build_tmp -# CUDA 4.0 on travis... work-around missing atomicAdd - - cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DCUDA_ARCH=sm_10 -DSAME_NVCC_FLAGS_IN_SUBPROJECTS=ON $TRAVIS_BUILD_DIR + - cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DCUDA_ARCH=$USE_SM -DSAME_NVCC_FLAGS_IN_SUBPROJECTS=ON $TRAVIS_BUILD_DIR - make - make install -before_script: +before_install: + - sudo apt-add-repository multiverse - sudo apt-get update -qq - - sudo apt-get install -qq build-essential - - sudo apt-get install -qq gcc-4.4 g++-4.4 - - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.4 + # nvcc 5.5: <= gcc 4.8 +# - sudo apt-get install -qq gcc-4.8 g++-4.8 +# - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8 - gcc --version && g++ --version - - sudo apt-get install -qq nvidia-common - - sudo apt-get install -qq nvidia-current - - sudo apt-get install -qq nvidia-cuda-toolkit nvidia-cuda-dev + - sudo apt-get install -qq nvidia-cuda-toolkit + - sudo apt-get install -qq nvidia-cuda-dev + - nvcc --version - if [ $USE_NVML -eq 1 ]; then wget $NVML_LINK$NVML_FILE && chmod u+x $NVML_FILE && sudo ./$NVML_FILE --silent --installdir=/ ; fi - if [ $USE_NVML -eq 1 ]; then export CMAKE_PREFIX_PATH=/usr/src/gdk/nvml/lib/ ; fi - sudo find /usr/ -name libcuda*.so diff --git a/cuda_memtest.h b/cuda_memtest.h index 6f24e984f74..7aba8ff231e 100644 --- a/cuda_memtest.h +++ b/cuda_memtest.h @@ -4,7 +4,7 @@ * University of Illinois/NCSA * Open Source License * - * Copyright © 2009, University of Illinois. All rights reserved. + * Copyright 2009, University of Illinois. All rights reserved. * * Developed by: * diff --git a/misc.cpp b/misc.cpp index 7e3c4471628..f8b1f6883dd 100644 --- a/misc.cpp +++ b/misc.cpp @@ -49,8 +49,10 @@ get_driver_info(char* info, unsigned int len) if ( fgets(info, len, file) == NULL){ PRINTF("Warning: reading file failed\n"); info[0] = 0; + fclose(file); return; } + fclose(file); PRINTF("%s", info); diff --git a/ocl_memtest.cpp b/ocl_memtest.cpp index 442efe63217..173fa9846f8 100644 --- a/ocl_memtest.cpp +++ b/ocl_memtest.cpp @@ -149,9 +149,11 @@ read_kernel_source(void) size_t rc = fread(kernel_source, 1, MAX_KERNEL_FILE_SIZE, fd); if (rc < 0 || rc >= MAX_KERNEL_FILE_SIZE){ printf("ERROR: return value out of range for reading kernel file(rc=%lx)\n", rc); + fclose(fd); exit(1); } + fclose(fd); return; } diff --git a/tests.cu b/tests.cu index af3159fdb13..0e3f127e058 100644 --- a/tests.cu +++ b/tests.cu @@ -4,7 +4,7 @@ * University of Illinois/NCSA * Open Source License * - * Copyright © 2009, University of Illinois. All rights reserved. + * Copyright 2009, University of Illinois. All rights reserved. * * Developed by: *