Skip to content

Commit

Permalink
add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
gilpazintel committed Jan 13, 2025
1 parent 73e07f4 commit 51bdbc5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/proc/pointcloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,14 @@ namespace librealsense
std::shared_ptr<pointcloud> pointcloud::create()
{
#ifdef RS2_USE_CUDA
std::cout << "RS2_USE_CUDA" << std::endl;
if (rsutils::rs2_is_gpu_available())
{
return std::make_shared<librealsense::pointcloud_cuda>();
}
#endif
#ifdef __SSSE3__
std::cout << "__SSSE3__" << std::endl;
return std::make_shared<librealsense::pointcloud_sse>();
#elif defined(__ARM_NEON) && ! defined ANDROID
return std::make_shared<librealsense::pointcloud_neon>();
Expand Down
7 changes: 7 additions & 0 deletions third-party/rsutils/src/rsutilgpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Copyright(c) 2023 Intel Corporation. All Rights Reserved.

#include "rsutils/rsutilgpu.h"
#include <rsutils/easylogging/easyloggingpp.h>

#ifdef RS2_USE_CUDA
#include <cuda_runtime.h>
Expand All @@ -15,6 +16,12 @@ namespace rsutils {
#ifdef RS2_USE_CUDA
static int gpuDeviceCount = -1;
if (gpuDeviceCount < 0) cudaGetDeviceCount(&gpuDeviceCount);
bool retVal = gpuDeviceCount > 0;
if (retVal == false)
{
// before push, change to INFO
LOG_ERROR("Avoid CUDA execution as no NVIDIA GPU found.");
}
return (gpuDeviceCount > 0);
#else
return false;
Expand Down

0 comments on commit 51bdbc5

Please sign in to comment.