Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
easyWave
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Merge Requests
0
Merge Requests
0
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
geoperil
easyWave
Commits
d3825031
Commit
d3825031
authored
Feb 09, 2014
by
Johannes Spazier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
All files were moved into a new subdirectory named "src/".
parent
917d9b0b
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
55 additions
and
36 deletions
+55
-36
cpu/trunk/src/EasyWave.cu
cpu/trunk/src/EasyWave.cu
+0
-0
cpu/trunk/src/Makefile
cpu/trunk/src/Makefile
+2
-5
cpu/trunk/src/cOgrd.cpp
cpu/trunk/src/cOgrd.cpp
+0
-0
cpu/trunk/src/cOgrd.h
cpu/trunk/src/cOgrd.h
+0
-0
cpu/trunk/src/cOkadaEarthquake.cpp
cpu/trunk/src/cOkadaEarthquake.cpp
+0
-0
cpu/trunk/src/cOkadaEarthquake.h
cpu/trunk/src/cOkadaEarthquake.h
+0
-0
cpu/trunk/src/cOkadaFault.cpp
cpu/trunk/src/cOkadaFault.cpp
+0
-0
cpu/trunk/src/cOkadaFault.h
cpu/trunk/src/cOkadaFault.h
+0
-0
cpu/trunk/src/cSphere.cpp
cpu/trunk/src/cSphere.cpp
+0
-0
cpu/trunk/src/cSphere.h
cpu/trunk/src/cSphere.h
+0
-0
cpu/trunk/src/easywave.h
cpu/trunk/src/easywave.h
+0
-0
cpu/trunk/src/ewCudaKernels.cu
cpu/trunk/src/ewCudaKernels.cu
+1
-3
cpu/trunk/src/ewCudaKernels.cuh
cpu/trunk/src/ewCudaKernels.cuh
+0
-2
cpu/trunk/src/ewGpuNode.cu
cpu/trunk/src/ewGpuNode.cu
+5
-4
cpu/trunk/src/ewGpuNode.cuh
cpu/trunk/src/ewGpuNode.cuh
+2
-0
cpu/trunk/src/ewGrid.cpp
cpu/trunk/src/ewGrid.cpp
+45
-22
cpu/trunk/src/ewNode.h
cpu/trunk/src/ewNode.h
+0
-0
cpu/trunk/src/ewOut2D.cpp
cpu/trunk/src/ewOut2D.cpp
+0
-0
cpu/trunk/src/ewPOIs.cpp
cpu/trunk/src/ewPOIs.cpp
+0
-0
cpu/trunk/src/ewParam.cpp
cpu/trunk/src/ewParam.cpp
+0
-0
cpu/trunk/src/ewReset.cpp
cpu/trunk/src/ewReset.cpp
+0
-0
cpu/trunk/src/ewSource.cpp
cpu/trunk/src/ewSource.cpp
+0
-0
cpu/trunk/src/ewStep.cpp
cpu/trunk/src/ewStep.cpp
+0
-0
cpu/trunk/src/okada.cpp
cpu/trunk/src/okada.cpp
+0
-0
cpu/trunk/src/utilits.cpp
cpu/trunk/src/utilits.cpp
+0
-0
cpu/trunk/src/utilits.h
cpu/trunk/src/utilits.h
+0
-0
No files found.
cpu/trunk/EasyWave.cu
→
cpu/trunk/
src/
EasyWave.cu
View file @
d3825031
File moved
cpu/trunk/Makefile
→
cpu/trunk/
src/
Makefile
View file @
d3825031
...
@@ -17,17 +17,14 @@ OBJECTS=$(patsubst %.cpp, %.o, $(CPPS) ) $(patsubst %.cu,%.o,$(CUS) )
...
@@ -17,17 +17,14 @@ OBJECTS=$(patsubst %.cpp, %.o, $(CPPS) ) $(patsubst %.cu,%.o,$(CUS) )
all
:
EasyWave
all
:
EasyWave
EasyWave
:
$(OBJECTS)
link.o
EasyWave
:
$(OBJECTS)
$(NVCC)
-o
$@
$^
$(NVCC)
-o
$@
$^
%.o
:
%.cpp *.h
%.o
:
%.cpp *.h
$(CC)
-c
$(CFLAGS)
-o
$@
$<
$(CC)
-c
$(CFLAGS)
-o
$@
$<
%.o
:
%.cu *.cuh *.h
%.o
:
%.cu *.cuh *.h
$(NVCC)
-dc
$(NVFLAGS)
-x
cu
-o
$@
$<
$(NVCC)
$(NVFLAGS)
-c
-x
cu
-o
$@
$<
link.o
:
$(CU_OBJS)
$(NVCC)
-dlink
$(NVFLAGS)
-o
$@
$^
clean
:
clean
:
rm
-f
EasyWave
*
.o
rm
-f
EasyWave
*
.o
cpu/trunk/cOgrd.cpp
→
cpu/trunk/
src/
cOgrd.cpp
View file @
d3825031
File moved
cpu/trunk/cOgrd.h
→
cpu/trunk/
src/
cOgrd.h
View file @
d3825031
File moved
cpu/trunk/cOkadaEarthquake.cpp
→
cpu/trunk/
src/
cOkadaEarthquake.cpp
View file @
d3825031
File moved
cpu/trunk/cOkadaEarthquake.h
→
cpu/trunk/
src/
cOkadaEarthquake.h
View file @
d3825031
File moved
cpu/trunk/cOkadaFault.cpp
→
cpu/trunk/
src/
cOkadaFault.cpp
View file @
d3825031
File moved
cpu/trunk/cOkadaFault.h
→
cpu/trunk/
src/
cOkadaFault.h
View file @
d3825031
File moved
cpu/trunk/cSphere.cpp
→
cpu/trunk/
src/
cSphere.cpp
View file @
d3825031
File moved
cpu/trunk/cSphere.h
→
cpu/trunk/
src/
cSphere.h
View file @
d3825031
File moved
cpu/trunk/easywave.h
→
cpu/trunk/
src/
easywave.h
View file @
d3825031
File moved
cpu/trunk/ewCudaKernels.cu
→
cpu/trunk/
src/
ewCudaKernels.cu
View file @
d3825031
#include "ewGpuNode.cuh"
#include "ewGpuNode.cuh"
#include "ewCudaKernels.cuh"
#include "ewCudaKernels.cuh"
__device__
int4
g_MinMax
=
{
0
,
0
,
0
,
0
};
__global__
void
runWaveUpdateKernel
(
KernelData
data
)
{
__global__
void
runWaveUpdateKernel
(
KernelData
data
)
{
Params
&
dp
=
data
.
params
;
Params
&
dp
=
data
.
params
;
...
@@ -209,5 +207,5 @@ __global__ void runGridExtendKernel2( KernelData data ) {
...
@@ -209,5 +207,5 @@ __global__ void runGridExtendKernel2( KernelData data ) {
tmp
.
z
=
dp
.
jMin
;
tmp
.
z
=
dp
.
jMin
;
tmp
.
w
=
dp
.
jMax
;
tmp
.
w
=
dp
.
jMax
;
g_MinMax
=
tmp
;
*
(
data
.
g_MinMax
)
=
tmp
;
}
}
cpu/trunk/ewCudaKernels.cuh
→
cpu/trunk/
src/
ewCudaKernels.cuh
View file @
d3825031
#ifndef EW_KERNELS_H
#ifndef EW_KERNELS_H
#define EW_KERNELS_H
#define EW_KERNELS_H
extern
__device__
int4
g_MinMax
;
__global__
void
runWaveUpdateKernel
(
KernelData
data
);
__global__
void
runWaveUpdateKernel
(
KernelData
data
);
__global__
void
runWaveBoundaryKernel
(
KernelData
data
);
__global__
void
runWaveBoundaryKernel
(
KernelData
data
);
__global__
void
runFluxUpdateKernel
(
KernelData
data
);
__global__
void
runFluxUpdateKernel
(
KernelData
data
);
...
...
cpu/trunk/ewGpuNode.cu
→
cpu/trunk/
src/
ewGpuNode.cu
View file @
d3825031
...
@@ -49,6 +49,8 @@ int CGpuNode::mallocMem() {
...
@@ -49,6 +49,8 @@ int CGpuNode::mallocMem() {
CUDA_CALL
(
cudaMalloc
(
&
(
data
.
cB3
),
dp
.
nI
*
sizeof
(
float
)
)
);
CUDA_CALL
(
cudaMalloc
(
&
(
data
.
cB3
),
dp
.
nI
*
sizeof
(
float
)
)
);
CUDA_CALL
(
cudaMalloc
(
&
(
data
.
cB4
),
dp
.
nJ
*
sizeof
(
float
)
)
);
CUDA_CALL
(
cudaMalloc
(
&
(
data
.
cB4
),
dp
.
nJ
*
sizeof
(
float
)
)
);
CUDA_CALL
(
cudaMalloc
(
&
(
data
.
g_MinMax
),
sizeof
(
int4
)
)
);
/* TODO: make sure that pitch is a multiple of 4 and the same for each cudaMallocPitch() call */
/* TODO: make sure that pitch is a multiple of 4 and the same for each cudaMallocPitch() call */
dp
.
pI
=
pitch
/
sizeof
(
float
);
dp
.
pI
=
pitch
/
sizeof
(
float
);
...
@@ -154,6 +156,8 @@ int CGpuNode::freeMem() {
...
@@ -154,6 +156,8 @@ int CGpuNode::freeMem() {
CUDA_CALL
(
cudaFree
(
data
.
cB3
)
);
CUDA_CALL
(
cudaFree
(
data
.
cB3
)
);
CUDA_CALL
(
cudaFree
(
data
.
cB4
)
);
CUDA_CALL
(
cudaFree
(
data
.
cB4
)
);
CUDA_CALL
(
cudaFree
(
data
.
g_MinMax
)
);
float
total_dur
=
0.
f
;
float
total_dur
=
0.
f
;
for
(
int
j
=
0
;
j
<
5
;
j
++
)
{
for
(
int
j
=
0
;
j
<
5
;
j
++
)
{
printf_v
(
"Duration %u: %.3f
\n
"
,
j
,
dur
[
j
]);
printf_v
(
"Duration %u: %.3f
\n
"
,
j
,
dur
[
j
]);
...
@@ -201,11 +205,8 @@ int CGpuNode::run() {
...
@@ -201,11 +205,8 @@ int CGpuNode::run() {
runGridExtendKernel2
<<<
1
,
1
>>>
(
data
);
runGridExtendKernel2
<<<
1
,
1
>>>
(
data
);
CUDA_CALL
(
cudaEventRecord
(
evtEnd
[
4
],
0
)
);
CUDA_CALL
(
cudaEventRecord
(
evtEnd
[
4
],
0
)
);
void
*
g_mm
;
CUDA_CALL
(
cudaGetSymbolAddress
(
&
g_mm
,
g_MinMax
)
);
int4
MinMax
;
int4
MinMax
;
CUDA_CALL
(
cudaMemcpy
(
&
MinMax
,
g_mm
,
sizeof
(
int4
),
cudaMemcpyDeviceToHost
)
);
CUDA_CALL
(
cudaMemcpy
(
&
MinMax
,
data
.
g_MinMax
,
sizeof
(
int4
),
cudaMemcpyDeviceToHost
)
);
cudaDeviceSynchronize
();
cudaDeviceSynchronize
();
Imin
=
dp
.
iMin
=
MinMax
.
x
;
Imin
=
dp
.
iMin
=
MinMax
.
x
;
Imax
=
dp
.
iMax
=
MinMax
.
y
;
Imax
=
dp
.
iMax
=
MinMax
.
y
;
...
...
cpu/trunk/ewGpuNode.cuh
→
cpu/trunk/
src/
ewGpuNode.cuh
View file @
d3825031
...
@@ -52,6 +52,8 @@ public:
...
@@ -52,6 +52,8 @@ public:
Params
params
;
Params
params
;
int4
*
g_MinMax
;
__device__
int
le
(
int
ij
)
{
return
ij
-
params
.
pI
;
}
__device__
int
le
(
int
ij
)
{
return
ij
-
params
.
pI
;
}
__device__
int
ri
(
int
ij
)
{
return
ij
+
params
.
pI
;
}
__device__
int
ri
(
int
ij
)
{
return
ij
+
params
.
pI
;
}
__device__
int
up
(
int
ij
)
{
return
ij
+
1
;
}
__device__
int
up
(
int
ij
)
{
return
ij
+
1
;
}
...
...
cpu/trunk/ewGrid.cpp
→
cpu/trunk/
src/
ewGrid.cpp
View file @
d3825031
...
@@ -74,36 +74,59 @@ int ewLoadBathymetry()
...
@@ -74,36 +74,59 @@ int ewLoadBathymetry()
Dx
=
Re
*
g2r
(
DLon
);
// in m along the equator
Dx
=
Re
*
g2r
(
DLon
);
// in m along the equator
Dy
=
Re
*
g2r
(
DLat
);
Dy
=
Re
*
g2r
(
DLat
);
/* NOTE: optimal would be reading everything in one step, but that does not work because rows and columns are transposed
if
(
isBin
)
{
* (only possible with binary data at all) - use temporary buffer for now (consumes additional memory!) */
float
*
buf
=
new
float
[
NLat
*
NLon
];
ierr
=
fread
(
buf
,
sizeof
(
float
),
NLat
*
NLon
,
fp
);
for
(
i
=
1
;
i
<=
NLon
;
i
++
)
{
/* NOTE: optimal would be reading everything in one step, but that does not work because rows and columns are transposed
for
(
j
=
1
;
j
<=
NLat
;
j
++
)
{
* (only possible with binary data at all) - use temporary buffer for now (consumes additional memory!) */
float
*
buf
=
new
float
[
NLat
*
NLon
];
ierr
=
fread
(
buf
,
sizeof
(
float
),
NLat
*
NLon
,
fp
);
m
=
idx
(
j
,
i
);
for
(
i
=
1
;
i
<=
NLon
;
i
++
)
{
for
(
j
=
1
;
j
<=
NLat
;
j
++
)
{
m
=
idx
(
j
,
i
);
if
(
isBin
)
if
(
isBin
)
fval
=
buf
[
(
j
-
1
)
*
NLon
+
(
i
-
1
)
];
fval
=
buf
[
(
j
-
1
)
*
NLon
+
(
i
-
1
)
];
//ierr = fread( &fval, sizeof(float), 1, fp );
//ierr = fread( &fval, sizeof(float), 1, fp );
else
ierr
=
fscanf
(
fp
,
" %f "
,
&
fval
);
Node
(
m
,
iTopo
)
=
fval
;
Node
(
m
,
iTopo
)
=
fval
;
Node
(
m
,
iTime
)
=
-
1
;
Node
(
m
,
iTime
)
=
-
1
;
Node
(
m
,
iD
)
=
-
fval
;
Node
(
m
,
iD
)
=
-
fval
;
if
(
Node
(
m
,
iD
)
<
0
)
{
if
(
Node
(
m
,
iD
)
<
0
)
{
Node
(
m
,
iD
)
=
0.0
f
;
Node
(
m
,
iD
)
=
0.0
f
;
}
else
if
(
Node
(
m
,
iD
)
<
Par
.
dmin
)
{
}
else
if
(
Node
(
m
,
iD
)
<
Par
.
dmin
)
{
Node
(
m
,
iD
)
=
Par
.
dmin
;
Node
(
m
,
iD
)
=
Par
.
dmin
;
}
}
}
}
}
delete
[]
buf
;
}
}
else
{
delete
[]
buf
;
for
(
j
=
1
;
j
<=
NLat
;
j
++
)
{
for
(
i
=
1
;
i
<=
NLon
;
i
++
)
{
m
=
idx
(
j
,
i
);
ierr
=
fscanf
(
fp
,
" %f "
,
&
fval
);
Node
(
m
,
iTopo
)
=
fval
;
Node
(
m
,
iTime
)
=
-
1
;
Node
(
m
,
iD
)
=
-
fval
;
if
(
Node
(
m
,
iD
)
<
0
)
{
Node
(
m
,
iD
)
=
0.0
f
;
}
else
if
(
Node
(
m
,
iD
)
<
Par
.
dmin
)
{
Node
(
m
,
iD
)
=
Par
.
dmin
;
}
}
}
}
for
(
k
=
1
;
k
<
MAX_VARS_PER_NODE
-
2
;
k
++
)
{
for
(
k
=
1
;
k
<
MAX_VARS_PER_NODE
-
2
;
k
++
)
{
Node
.
initMemory
(
k
,
0
);
Node
.
initMemory
(
k
,
0
);
...
...
cpu/trunk/ewNode.h
→
cpu/trunk/
src/
ewNode.h
View file @
d3825031
File moved
cpu/trunk/ewOut2D.cpp
→
cpu/trunk/
src/
ewOut2D.cpp
View file @
d3825031
File moved
cpu/trunk/ewPOIs.cpp
→
cpu/trunk/
src/
ewPOIs.cpp
View file @
d3825031
File moved
cpu/trunk/ewParam.cpp
→
cpu/trunk/
src/
ewParam.cpp
View file @
d3825031
File moved
cpu/trunk/ewReset.cpp
→
cpu/trunk/
src/
ewReset.cpp
View file @
d3825031
File moved
cpu/trunk/ewSource.cpp
→
cpu/trunk/
src/
ewSource.cpp
View file @
d3825031
File moved
cpu/trunk/ewStep.cpp
→
cpu/trunk/
src/
ewStep.cpp
View file @
d3825031
File moved
cpu/trunk/okada.cpp
→
cpu/trunk/
src/
okada.cpp
View file @
d3825031
File moved
cpu/trunk/utilits.cpp
→
cpu/trunk/
src/
utilits.cpp
View file @
d3825031
File moved
cpu/trunk/utilits.h
→
cpu/trunk/
src/
utilits.h
View file @
d3825031
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment