This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
71 additions
and
39 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/*! | ||
* Copyright (c) 2017 by Contributors | ||
* \file cuda_utils.cc | ||
* \brief CUDA debugging utilities. | ||
*/ | ||
|
||
#include <mxnet/base.h> | ||
#include <mshadow/base.h> | ||
#include "cuda_utils.h" | ||
|
||
#if MXNET_USE_CUDA | ||
|
||
namespace mxnet { | ||
namespace common { | ||
namespace cuda { | ||
|
||
int get_load_type(size_t N) { | ||
using namespace mshadow; | ||
if (N % 8 == 0) { | ||
return kFloat64; | ||
} else if (N % 4 == 0) { | ||
return kFloat32; | ||
} else if (N % 2 == 0) { | ||
return kFloat16; | ||
} else { | ||
return kInt8; | ||
} | ||
} | ||
} // namespace cuda | ||
} // namespace common | ||
} // namespace mxnet | ||
|
||
#endif // MXNET_USE_CUDA |
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
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