Skip to content

Commit f1a9263

Browse files
authored
Support double param (#33)
1 parent 1487ea6 commit f1a9263

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/build
22
/.vscode
33
*.so
4+
build

server/src/server_wrapper.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
// Copyright 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
//
33
// Redistribution and use in source and binary forms, with or without
44
// modification, are permitted provided that the following conditions
@@ -368,8 +368,8 @@ struct ResponseParameters {
368368
// The name of the parameter.
369369
const char* name_;
370370
// The type of the parameter. Valid types are TRITONSERVER_PARAMETER_STRING,
371-
// TRITONSERVER_PARAMETER_INT, TRITONSERVER_PARAMETER_BOOL, and
372-
// TRITONSERVER_PARAMETER_BYTES.
371+
// TRITONSERVER_PARAMETER_INT, TRITONSERVER_PARAMETER_BOOL,
372+
// TRITONSERVER_PARAMETER_BYTES and TRITONSERVER_PARAMETER_DOUBLE.
373373
TRITONSERVER_ParameterType type_;
374374
// The pointer to the parameter value.
375375
const void* vvalue_;
@@ -2057,6 +2057,11 @@ InferResult::DebugString()
20572057
params_[i]->name_,
20582058
reinterpret_cast<const char*>(params_[i]->vvalue_)));
20592059
break;
2060+
case TRITONSERVER_PARAMETER_DOUBLE:
2061+
THROW_IF_TRITON_ERR(params_json.AddDouble(
2062+
params_[i]->name_,
2063+
*(reinterpret_cast<const double*>(params_[i]->vvalue_))));
2064+
break;
20602065
case TRITONSERVER_PARAMETER_BYTES:
20612066
throw TritonException(
20622067
std::string("Error - DebugString: ") +

0 commit comments

Comments
 (0)