Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/libtorch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <stdint.h>

#include <cstdint>
#include <exception>

Expand Down Expand Up @@ -1860,8 +1861,8 @@ ModelInstanceState::SetInputTensors(
// The inputs must be in contiguous CPU/GPU memory.
std::vector<std::pair<TRITONSERVER_MemoryType, int64_t>> alloc_perference;
if (device_.is_cpu()) {
alloc_perference = {{TRITONSERVER_MEMORY_CPU_PINNED, 0},
{TRITONSERVER_MEMORY_CPU, 0}};
alloc_perference = {
{TRITONSERVER_MEMORY_CPU_PINNED, 0}, {TRITONSERVER_MEMORY_CPU, 0}};
} else {
alloc_perference = {{TRITONSERVER_MEMORY_GPU, device_.index()}};
}
Expand Down Expand Up @@ -1914,8 +1915,8 @@ ModelInstanceState::SetInputTensors(
// For 'KIND_MODEL', input will always be in CPU as we don't have a way to
// query the input types.
if (device_.is_cpu() || (Kind() == TRITONSERVER_INSTANCEGROUPKIND_MODEL)) {
alloc_perference = {{TRITONSERVER_MEMORY_CPU_PINNED, 0},
{TRITONSERVER_MEMORY_CPU, 0}};
alloc_perference = {
{TRITONSERVER_MEMORY_CPU_PINNED, 0}, {TRITONSERVER_MEMORY_CPU, 0}};
} else {
alloc_perference = {{TRITONSERVER_MEMORY_GPU, device_.index()}};
}
Expand Down