Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cs267
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
recolic-hust
cs267
Commits
8b077d5f
There was an error fetching the commit references. Please try again later.
Unverified
Commit
8b077d5f
authored
6 years ago
by
Recolic Keghart
Browse files
Options
Downloads
Patches
Plain Diff
sync
parent
dd51ce2f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hw2/appendable_array.cuh
+2
-2
2 additions, 2 deletions
hw2/appendable_array.cuh
hw2/cuda_ass.cuh
+1
-1
1 addition, 1 deletion
hw2/cuda_ass.cuh
with
3 additions
and
3 deletions
hw2/appendable_array.cuh
+
2
−
2
View file @
8b077d5f
...
@@ -113,7 +113,7 @@ namespace rlib {
...
@@ -113,7 +113,7 @@ namespace rlib {
private
:
private
:
__host__
void
apply_new_cap
()
{
__host__
void
apply_new_cap
()
{
void
*
new_mem
;
void
*
new_mem
;
rlib
::
cuda_assert
(
cudaMalloc
(
&
new_mem
,
cap
));
rlib
::
cuda_assert
(
cudaMalloc
Managed
(
&
new_mem
,
cap
));
if
(
new_mem
==
nullptr
)
if
(
new_mem
==
nullptr
)
throw
std
::
runtime_error
(
"Failed to allocate memory."
);
throw
std
::
runtime_error
(
"Failed to allocate memory."
);
if
(
mem
!=
nullptr
)
{
if
(
mem
!=
nullptr
)
{
...
@@ -125,7 +125,7 @@ namespace rlib {
...
@@ -125,7 +125,7 @@ namespace rlib {
__device__
bool
dev_apply_new_cap
()
{
__device__
bool
dev_apply_new_cap
()
{
void
*
new_mem
=
nullptr
;
void
*
new_mem
=
nullptr
;
rlib
::
dev_cuda_assert
(
cudaMalloc
(
&
new_mem
,
cap
));
rlib
::
dev_cuda_assert
(
cudaMalloc
Managed
(
&
new_mem
,
cap
));
if
(
new_mem
==
nullptr
)
if
(
new_mem
==
nullptr
)
return
false
;
return
false
;
if
(
mem
!=
nullptr
)
{
if
(
mem
!=
nullptr
)
{
...
...
This diff is collapsed.
Click to expand it.
hw2/cuda_ass.cuh
+
1
−
1
View file @
8b077d5f
...
@@ -8,7 +8,7 @@ namespace rlib {
...
@@ -8,7 +8,7 @@ namespace rlib {
}
}
__device__
bool
dev_cuda_assert
(
cudaError_t
err
)
{
__device__
bool
dev_cuda_assert
(
cudaError_t
err
)
{
if
(
err
!=
cudaError
::
cudaSuccess
)
{
if
(
err
!=
cudaError
::
cudaSuccess
)
{
printf
(
"FUCK! CUDA runtime error: %d, %s
\n
"
,
err
,
cudaGetErrorString
(
err
));
printf
(
"FUCK! CUDA runtime error: %d, %s
\n
"
,
err
,
"fuck"
);
//
cudaGetErrorString(err));
return
false
;
return
false
;
}
}
return
true
;
return
true
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment