Skip to content

Commit

Permalink
Fix some warnings that only happen in a release build
Browse files Browse the repository at this point in the history
  • Loading branch information
skottmckay committed Feb 27, 2024
1 parent a6aa359 commit a43aaad
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ void InvokeTranspose(
const T* query, const T* key, const T* value, const T* bias, T* output,
const int batch_size, const int sequence_length,
const int num_heads, const int qk_head_size, const int v_head_size,
AttentionQkvFormat source_format, AttentionQkvFormat target_format,
[[maybe_unused]] AttentionQkvFormat source_format, AttentionQkvFormat target_format,
const int32_t* token_offset, int32_t token_count,
cudaStream_t stream) {
if (key != nullptr && value != nullptr) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif

// Ignore CUTLASS warning C4100: unreferenced formal parameter
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable : 4100)
#endif

#include "cutlass/array.h"
#include "cutlass/numeric_conversion.h"
#include "cutlass/layout/matrix.h"
Expand All @@ -36,6 +42,10 @@
#include "layout_traits_helper.h"
#include "moe_cutlass_kernel.h"

#if defined(_MSC_VER)
#pragma warning(pop)
#endif

#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ using namespace onnxruntime;
namespace onnxruntime {

common::Status LoadDynamicLibrary(onnxruntime::PathString library_name);
common::Status CreateTensorRTCustomOpDomainList(std::vector<OrtCustomOpDomain*>& domain_list, const std::string extra_plugin_lib_paths);
common::Status CreateTensorRTCustomOpDomainList(std::vector<OrtCustomOpDomain*>& domain_list,
const std::string extra_plugin_lib_paths);

Check warning on line 17 in onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.h

View workflow job for this annotation

GitHub Actions / Lint C++

[cpplint] reported by reviewdog 🐶 Add #include <string> for string [build/include_what_you_use] [4] Raw Output: onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.h:17: Add #include <string> for string [build/include_what_you_use] [4]
common::Status CreateTensorRTCustomOpDomainList(TensorrtExecutionProviderInfo& info);
void ReleaseTensorRTCustomOpDomain(OrtCustomOpDomain* domain);
void ReleaseTensorRTCustomOpDomainList(std::vector<OrtCustomOpDomain*>& custom_op_domain_list);
Expand All @@ -23,16 +24,22 @@ struct TensorRTCustomKernel {
: compute_stream_(compute_stream) {
}

void Compute(OrtKernelContext* context){}; // The implementation is in TensorRT plugin. No need to implement it here.
void Compute(OrtKernelContext* /*context*/){
// The implementation is in TensorRT plugin. No need to implement it here.
};

Check warning on line 29 in onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.h

View workflow job for this annotation

GitHub Actions / Lint C++

[cpplint] reported by reviewdog 🐶 You don't need a ; after a } [readability/braces] [4] Raw Output: onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.h:29: You don't need a ; after a } [readability/braces] [4]

private:
void* compute_stream_;
};

struct TensorRTCustomOp : Ort::CustomOpBase<TensorRTCustomOp, TensorRTCustomKernel> {
explicit TensorRTCustomOp(const char* provider, void* compute_stream) : provider_(provider), compute_stream_(compute_stream) {}
explicit TensorRTCustomOp(const char* provider, void* compute_stream) : provider_(provider),
compute_stream_(compute_stream) {
}

void* CreateKernel(const OrtApi& /* api */, const OrtKernelInfo* info) const { return new TensorRTCustomKernel(info, compute_stream_); };
void* CreateKernel(const OrtApi& /* api */, const OrtKernelInfo* info) const {
return new TensorRTCustomKernel(info, compute_stream_);
};

Check warning on line 42 in onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.h

View workflow job for this annotation

GitHub Actions / Lint C++

[cpplint] reported by reviewdog 🐶 You don't need a ; after a } [readability/braces] [4] Raw Output: onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.h:42: You don't need a ; after a } [readability/braces] [4]

const char* GetName() const { return name_; };

Expand All @@ -46,15 +53,19 @@ struct TensorRTCustomOp : Ort::CustomOpBase<TensorRTCustomOp, TensorRTCustomKern

ONNXTensorElementDataType GetInputType(size_t /*index*/) const { return ONNX_TENSOR_ELEMENT_DATA_TYPE_UNDEFINED; };

OrtCustomOpInputOutputCharacteristic GetInputCharacteristic(size_t) const { return OrtCustomOpInputOutputCharacteristic::INPUT_OUTPUT_VARIADIC; };
OrtCustomOpInputOutputCharacteristic GetInputCharacteristic(size_t) const {
return OrtCustomOpInputOutputCharacteristic::INPUT_OUTPUT_VARIADIC;
};

Check warning on line 58 in onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.h

View workflow job for this annotation

GitHub Actions / Lint C++

[cpplint] reported by reviewdog 🐶 You don't need a ; after a } [readability/braces] [4] Raw Output: onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.h:58: You don't need a ; after a } [readability/braces] [4]

size_t GetOutputTypeCount() const { return num_outputs_; };

void SetOutputTypeCount(size_t num) { num_outputs_ = num; };

ONNXTensorElementDataType GetOutputType(size_t /*index*/) const { return ONNX_TENSOR_ELEMENT_DATA_TYPE_UNDEFINED; };

OrtCustomOpInputOutputCharacteristic GetOutputCharacteristic(size_t) const { return OrtCustomOpInputOutputCharacteristic::INPUT_OUTPUT_VARIADIC; };
OrtCustomOpInputOutputCharacteristic GetOutputCharacteristic(size_t) const {
return OrtCustomOpInputOutputCharacteristic::INPUT_OUTPUT_VARIADIC;
};

Check warning on line 68 in onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.h

View workflow job for this annotation

GitHub Actions / Lint C++

[cpplint] reported by reviewdog 🐶 You don't need a ; after a } [readability/braces] [4] Raw Output: onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.h:68: You don't need a ; after a } [readability/braces] [4]

bool GetVariadicInputHomogeneity() const {
return false; // heterogenous
Expand Down

0 comments on commit a43aaad

Please sign in to comment.