Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torchani
Commits
d2d63056
Unverified
Commit
d2d63056
authored
Nov 24, 2020
by
Richard Xue
Committed by
GitHub
Nov 24, 2020
Browse files
CRLF to LF (#553)
* line-limit 120 * CRLF to LF
parent
a6d819ed
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
585 additions
and
615 deletions
+585
-615
.clang-format
.clang-format
+1
-1
torchani/cuaev/aev.cu
torchani/cuaev/aev.cu
+584
-614
No files found.
.clang-format
View file @
d2d63056
...
@@ -35,7 +35,7 @@ BreakBeforeTernaryOperators: true
...
@@ -35,7 +35,7 @@ BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializersBeforeComma: false
BreakAfterJavaFieldAnnotations: false
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: false
BreakStringLiterals: false
ColumnLimit: 1
0
0
ColumnLimit: 1
2
0
CommentPragmas: '^ IWYU pragma:'
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerAllOnOneLineOrOnePerLine: true
...
...
torchani/cuaev/aev.cu
View file @
d2d63056
...
@@ -206,8 +206,7 @@ __global__ void cuAngularAEVs(
...
@@ -206,8 +206,7 @@ __global__ void cuAngularAEVs(
DataT
theta
=
0
;
DataT
theta
=
0
;
if
(
kk
<
jnum
)
{
if
(
kk
<
jnum
)
{
const
DataT
Rik
=
sdist
[
kk
];
const
DataT
Rik
=
sdist
[
kk
];
theta
=
theta
=
acos
(
0.95
*
(
sdx
[
jj
]
*
sdx
[
kk
]
+
sdy
[
jj
]
*
sdy
[
kk
]
+
sdz
[
jj
]
*
sdz
[
kk
])
/
(
Rij
*
Rik
));
acos
(
0.95
*
(
sdx
[
jj
]
*
sdx
[
kk
]
+
sdy
[
jj
]
*
sdy
[
kk
]
+
sdz
[
jj
]
*
sdz
[
kk
])
/
(
Rij
*
Rik
));
}
}
for
(
int
srcLane
=
0
;
kk_start
+
srcLane
<
min
(
32
,
jnum
);
++
srcLane
)
{
for
(
int
srcLane
=
0
;
kk_start
+
srcLane
<
min
(
32
,
jnum
);
++
srcLane
)
{
...
@@ -319,14 +318,7 @@ int cubEncode(
...
@@ -319,14 +318,7 @@ int cubEncode(
void
*
d_temp_storage
=
NULL
;
void
*
d_temp_storage
=
NULL
;
size_t
temp_storage_bytes
=
0
;
size_t
temp_storage_bytes
=
0
;
cub
::
DeviceRunLengthEncode
::
Encode
(
cub
::
DeviceRunLengthEncode
::
Encode
(
d_temp_storage
,
d_temp_storage
,
temp_storage_bytes
,
d_in
,
d_unique_out
,
d_counts_out
,
d_num_runs_out
,
num_items
,
stream
);
temp_storage_bytes
,
d_in
,
d_unique_out
,
d_counts_out
,
d_num_runs_out
,
num_items
,
stream
);
// Allocate temporary storage
// Allocate temporary storage
auto
buffer_tmp
=
allocator
.
allocate
(
temp_storage_bytes
);
auto
buffer_tmp
=
allocator
.
allocate
(
temp_storage_bytes
);
...
@@ -334,14 +326,7 @@ int cubEncode(
...
@@ -334,14 +326,7 @@ int cubEncode(
// Run encoding
// Run encoding
cub
::
DeviceRunLengthEncode
::
Encode
(
cub
::
DeviceRunLengthEncode
::
Encode
(
d_temp_storage
,
d_temp_storage
,
temp_storage_bytes
,
d_in
,
d_unique_out
,
d_counts_out
,
d_num_runs_out
,
num_items
,
stream
);
temp_storage_bytes
,
d_in
,
d_unique_out
,
d_counts_out
,
d_num_runs_out
,
num_items
,
stream
);
int
num_selected
=
0
;
int
num_selected
=
0
;
cudaMemcpyAsync
(
&
num_selected
,
d_num_runs_out
,
sizeof
(
int
),
cudaMemcpyDefault
,
stream
);
cudaMemcpyAsync
(
&
num_selected
,
d_num_runs_out
,
sizeof
(
int
),
cudaMemcpyDefault
,
stream
);
...
@@ -362,8 +347,7 @@ int cubDeviceSelect(
...
@@ -362,8 +347,7 @@ int cubDeviceSelect(
// Determine temporary device storage requirements
// Determine temporary device storage requirements
void
*
d_temp_storage
=
NULL
;
void
*
d_temp_storage
=
NULL
;
size_t
temp_storage_bytes
=
0
;
size_t
temp_storage_bytes
=
0
;
cub
::
DeviceSelect
::
If
(
cub
::
DeviceSelect
::
If
(
d_temp_storage
,
temp_storage_bytes
,
d_in
,
d_out
,
d_num_selected_out
,
num_items
,
select_op
);
d_temp_storage
,
temp_storage_bytes
,
d_in
,
d_out
,
d_num_selected_out
,
num_items
,
select_op
);
// Allocate temporary storage
// Allocate temporary storage
auto
buffer_tmp
=
allocator
.
allocate
(
temp_storage_bytes
);
auto
buffer_tmp
=
allocator
.
allocate
(
temp_storage_bytes
);
...
@@ -371,14 +355,7 @@ int cubDeviceSelect(
...
@@ -371,14 +355,7 @@ int cubDeviceSelect(
// Run selection
// Run selection
cub
::
DeviceSelect
::
If
(
cub
::
DeviceSelect
::
If
(
d_temp_storage
,
d_temp_storage
,
temp_storage_bytes
,
d_in
,
d_out
,
d_num_selected_out
,
num_items
,
select_op
,
stream
);
temp_storage_bytes
,
d_in
,
d_out
,
d_num_selected_out
,
num_items
,
select_op
,
stream
);
int
num_selected
=
0
;
int
num_selected
=
0
;
cudaMemcpyAsync
(
&
num_selected
,
d_num_selected_out
,
sizeof
(
int
),
cudaMemcpyDefault
,
stream
);
cudaMemcpyAsync
(
&
num_selected
,
d_num_selected_out
,
sizeof
(
int
),
cudaMemcpyDefault
,
stream
);
...
@@ -425,12 +402,7 @@ void initConsts(AEVScalarParams<float>& aev_params, cudaStream_t stream) {
...
@@ -425,12 +402,7 @@ void initConsts(AEVScalarParams<float>& aev_params, cudaStream_t stream) {
}
}
}
}
cudaMemcpyToSymbolAsync
(
cudaMemcpyToSymbolAsync
(
csubaev_offsets
,
csubaev_offsets
,
subaev_offsets
,
sizeof
(
int
)
*
num_species
*
num_species
,
0
,
cudaMemcpyDefault
,
stream
);
subaev_offsets
,
sizeof
(
int
)
*
num_species
*
num_species
,
0
,
cudaMemcpyDefault
,
stream
);
delete
[]
subaev_offsets
;
delete
[]
subaev_offsets
;
}
}
...
@@ -449,8 +421,7 @@ torch::Tensor cuComputeAEV(
...
@@ -449,8 +421,7 @@ torch::Tensor cuComputeAEV(
torch
::
Tensor
ShfZ_t
,
torch
::
Tensor
ShfZ_t
,
int64_t
num_species_
)
{
int64_t
num_species_
)
{
TORCH_CHECK
(
TORCH_CHECK
(
(
species_t
.
dtype
()
==
torch
::
kInt32
)
&&
(
coordinates_t
.
dtype
()
==
torch
::
kFloat32
),
(
species_t
.
dtype
()
==
torch
::
kInt32
)
&&
(
coordinates_t
.
dtype
()
==
torch
::
kFloat32
),
"Unsupported input type"
);
"Unsupported input type"
);
TORCH_CHECK
(
TORCH_CHECK
(
EtaR_t
.
size
(
0
)
==
1
||
EtaA_t
.
size
(
0
)
==
1
||
Zeta_t
.
size
(
0
)
==
1
,
EtaR_t
.
size
(
0
)
==
1
||
EtaA_t
.
size
(
0
)
==
1
||
Zeta_t
.
size
(
0
)
==
1
,
"cuda extension is currently not supported for the specified "
"cuda extension is currently not supported for the specified "
...
@@ -559,8 +530,7 @@ torch::Tensor cuComputeAEV(
...
@@ -559,8 +530,7 @@ torch::Tensor cuComputeAEV(
int
*
d_numPairsPerCenterAtom
=
(
int
*
)
buffer_numPairsPerCenterAtom
.
get
();
int
*
d_numPairsPerCenterAtom
=
(
int
*
)
buffer_numPairsPerCenterAtom
.
get
();
// group by center atom
// group by center atom
int
ncenter_atoms
=
cubEncode
(
int
ncenter_atoms
=
cubEncode
(
d_angularRij
,
d_centralAtom
,
d_numPairsPerCenterAtom
,
nAngularRij
,
d_count_out
,
stream
);
d_angularRij
,
d_centralAtom
,
d_numPairsPerCenterAtom
,
nAngularRij
,
d_count_out
,
stream
);
auto
buffer_centerAtomStartIdx
=
allocator
.
allocate
(
sizeof
(
int
)
*
ncenter_atoms
);
auto
buffer_centerAtomStartIdx
=
allocator
.
allocate
(
sizeof
(
int
)
*
ncenter_atoms
);
int
*
d_centerAtomStartIdx
=
(
int
*
)
buffer_centerAtomStartIdx
.
get
();
int
*
d_centerAtomStartIdx
=
(
int
*
)
buffer_centerAtomStartIdx
.
get
();
...
...
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