Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kashif Rasul committed Jul 31, 2011
0 parents commit 16b937c
Show file tree
Hide file tree
Showing 119 changed files with 374,583 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .gitignore
@@ -0,0 +1,43 @@
# This file is used to ignore files which are generated
# ----------------------------------------------------------------------------

*.o
.DS_Store
.svn

# CMake generated files
Makefile*
CMakeFiles
CMakeCache.txt
cmake_install.cmake

# Vim temporary files
.*.swp

# Visual Studio generated files
*.ib_pdb_index
*.idb
*.ilk
*.pdb
*.sln
*.suo
*.sdf
*.vcproj
*vcproj.*.*.user
*.vcxproj
*.vcxproj.user
*.vcxproj.filters
*vcxproj.*.*.user
*.ncb
*.dir
Debug
Release

# Log files
src/*/*.csv

# Binaries
# --------

bin
lib
22 changes: 22 additions & 0 deletions CMakeLists.txt
@@ -0,0 +1,22 @@
cmake_minimum_required (VERSION 2.8.5)

set (CMAKE_MODULE_PATH
"${CMAKE_SOURCE_DIR}/cmake"
${CMAKE_MODULE_PATH}
)

find_package (CUDA 4.0 REQUIRED)

set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)

if(UNIX)
add_definitions(-DUNIX)
endif(UNIX)

add_subdirectory(cutil)
add_subdirectory(shrutil)
add_subdirectory(src)

CUDA_BUILD_CLEAN_TARGET()
41 changes: 41 additions & 0 deletions Readme.md
@@ -0,0 +1,41 @@
# CUDA Workshop Projects

Here is an organized folder to develop CUDA applications which should work unchanged under Mac OS X, Linux or Windows.

## Configuration

Install CMake from:
http://cmake.org/cmake/resources/software.html

Install CUDA 4.0 from:
http://developer.nvidia.com/cuda-downloads

## Adding a new project

In the `src/` create a project folder e.g. `matrixMul/` with its source files and create a new `CMakeLists.txt` listing the source files and the libraries to link against e.g.:

CUDA_ADD_EXECUTABLE(matrixMul
matrixMul.cu
matrixMul_gold.cpp
)

TARGET_LINK_LIBRARIES(matrixMul
cutil
shrutil
)

Finally add the `matrixMul` sub-directory to the `src/CMakeLists.txt` file e.g.:

add_subdirectory (matrixMul)

## Compiling

Open a Visual Studio command shell or a terminal in Mac OS X or Linux and go to the top directory and do:

$ cmake CMakeLists.txt

Under Windows this should create a Visual Studio project file which you can open, and under Mac OS X or Linux do:

$ make

and hopefully the CUDA executable will be compiled in the `bin/` folder.

0 comments on commit 16b937c

Please sign in to comment.