Skip to content

Commit 1d0d3ea

Browse files
committed
Added code for blog post on CUDA OS X C++-11
1 parent 567a4bd commit 1d0d3ea

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

.DS_Store

6 KB
Binary file not shown.

playtime/Python/curse-of-dim/tst.py

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/python
2+
3+
import math
4+
5+
R = 1
6+
STEP_SIZE=.05
7+
print 'R, "% VOLUME"'
8+
print "******"
9+
10+
TOTAL_AREA=math.pi*R**2
11+
NSTEPS=int(R/STEP_SIZE)
12+
for i in range(1, NSTEPS+1):
13+
r=i*STEP_SIZE
14+
area = math.pi*r**2
15+
print r, area/TOTAL_AREA
16+
17+
print "******"
18+
19+
TOTAL_VOLUME=4.0/3.0*math.pi*R**3
20+
for i in range(1, NSTEPS+1):
21+
r=i*STEP_SIZE
22+
vol = 4.0/3.0*math.pi*r**3
23+
print r, vol/TOTAL_VOLUME
24+
25+
26+
27+
28+
29+
30+
31+
32+

posts/cuda_os_x_cxx_11/README

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The code in this directory is written about at:
1+
The code in this directory is written about at: http://wp.me/p1Pqiu-9X
22

33
The basic idea is that CUDA under OS X is only supported with g++, and in fact clang++ will
44
choke due to a number of reasons, one of which is support for certain atomic instructions, the

0 commit comments

Comments
 (0)