-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com>
- Loading branch information
Showing
10 changed files
with
110 additions
and
84 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/************************************************************************* | ||
* Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
* | ||
* See LICENSE for license information. | ||
************************************************************************/ | ||
|
||
#ifndef TRANSFORMER_ENGINE_CUDNN_UTILS_H_ | ||
#define TRANSFORMER_ENGINE_CUDNN_UTILS_H_ | ||
|
||
#include <cudnn.h> | ||
#include <cudnn_frontend.h> | ||
#include <cudnn_frontend_utils.h> | ||
|
||
#include <cstdint> | ||
#include <mutex> | ||
|
||
#include "transformer_engine/transformer_engine.h" | ||
|
||
namespace transformer_engine { | ||
|
||
cudnnDataType_t get_cudnn_dtype(const transformer_engine::DType t); | ||
|
||
cudnn_frontend::DataType_t get_cudnn_fe_dtype(const transformer_engine::DType t); | ||
|
||
class cudnnExecutionPlanManager { | ||
public: | ||
static cudnnExecutionPlanManager &Instance() { | ||
static thread_local cudnnExecutionPlanManager instance; | ||
return instance; | ||
} | ||
|
||
cudnnHandle_t GetCudnnHandle() { | ||
static thread_local std::once_flag flag; | ||
std::call_once(flag, [&] { cudnnCreate(&handle_); }); | ||
return handle_; | ||
} | ||
|
||
~cudnnExecutionPlanManager() {} | ||
|
||
private: | ||
cudnnHandle_t handle_ = nullptr; | ||
}; | ||
|
||
} // namespace transformer_engine | ||
|
||
#endif |
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
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
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
This file was deleted.
Oops, something went wrong.