This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### CMakeLists.txt for CUDA | |
cmake_minimum_required(VERSION 2.8) | |
find_package(CUDA QUIET REQUIRED) | |
# Pass options to NVCC | |
set( | |
CUDA_NVCC_FLAGS | |
${CUDA_NVCC_FLAGS}; | |
-O3 -gencode arch=compute_22,code=sm_22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%-----------------------------------------------------------------------------% | |
% Letter class | |
\documentclass[a4paper, 10pt]{letter} | |
% Name of sender | |
\name{Joe Fox} | |
% Signature of sender | |
\signature{Joe Fox} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# IronPython example program to demonstrate OpenTK | |
# | |
# Steps: | |
# 1. Create an empty IronPython project in Visual Studio | |
# 2. Place OpenTK.dll in the directory of the Python source file | |
# 3. Paste this source code into the Python source file | |
# 4. Run. You should see a colored triangle. Press ESC to quit. | |
# | |
# Copyright (c) 2013 Ashwin Nanjappa | |
# Released under the MIT License |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Add the packages | |
\usepackage{algorithm} | |
\usepackage{algpseudocode} | |
% Insert the algorithm | |
\begin{algorithm} | |
\caption{Compute sum of integers in array} | |
\label{array-sum} | |
\begin{algorithmic}[1] | |
\Procedure{ArraySum}{$A$} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\begin{figure} | |
\centering | |
\subfloat[] | |
{ | |
\includegraphics[scale=.6]{fig-1.pdf} | |
\label{fig:foo-1} | |
} | |
\par | |
\subfloat[] | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Doxyfile 1.8.6 | |
# This file describes the settings to be used by the documentation system | |
# doxygen (www.doxygen.org) for a project. | |
# | |
# All text after a double hash (##) is considered a comment and is placed in | |
# front of the TAG it is preceding. | |
# | |
# All text after a single hash (#) is considered a comment and will be ignored. | |
# The format is: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Package for subfloat | |
\usepackage{subfig} | |
% Figure with two sub-figures | |
\begin{figure} | |
\centering | |
\subfloat[] | |
{ | |
\includegraphics[scale=.5]{fig-1.pdf} | |
\label{fig:foo-1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <getopt.h> | |
#include <iostream> | |
int num = -1; | |
bool is_beep = false; | |
float sigma = 2.034; | |
std::string write_file = "default_file.txt"; | |
void PrintHelp() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <future> | |
float DoWork(int idx) | |
{ | |
// Do some hard computation using idx | |
// and internal read-only data structures | |
// Return the float result | |
} | |
void DoAsync() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <thrust/device_vector.h> | |
#include <thrust/random.h> | |
struct GenRand | |
{ | |
__device__ | |
float operator () (int idx) | |
{ | |
thrust::default_random_engine randEng; | |
thrust::uniform_real_distribution<float> uniDist; |
NewerOlder