Apply constexpr on global constant varaibles
When HIP_ENABLE_DEFERRED_LOADING=0, many global variables will be
referenced but they are not initialized in that early time. The patch
will use constexpr to initialze global constant varables in compile
time.
Change-Id: I9d538b7abc6a0ce700ec3332b97fc144db5fc1ef
[ROCm/clr commit: fdef6f722f]
This commit is contained in:
@@ -551,7 +551,7 @@ class WriteMemoryCommand : public OneMemoryArgCommand {
|
||||
|
||||
class FillMemoryCommand : public OneMemoryArgCommand {
|
||||
public:
|
||||
const static size_t MaxFillPatterSize = sizeof(double[16]);
|
||||
static constexpr size_t MaxFillPatterSize = sizeof(double[16]);
|
||||
|
||||
private:
|
||||
Coord3D origin_; //!< Origin of the region to write to.
|
||||
@@ -1309,9 +1309,9 @@ class SvmUnmapMemoryCommand : public Command {
|
||||
*/
|
||||
class TransferBufferFileCommand : public OneMemoryArgCommand {
|
||||
public:
|
||||
static const uint NumStagingBuffers = 2;
|
||||
static const size_t StagingBufferSize = 4 * Mi;
|
||||
static const uint StagingBufferMemType = CL_MEM_USE_PERSISTENT_MEM_AMD;
|
||||
static constexpr uint NumStagingBuffers = 2;
|
||||
static constexpr size_t StagingBufferSize = 4 * Mi;
|
||||
static constexpr uint StagingBufferMemType = CL_MEM_USE_PERSISTENT_MEM_AMD;
|
||||
|
||||
protected:
|
||||
const Coord3D origin_; //!< Origin of the region to write to
|
||||
|
||||
Reference in New Issue
Block a user