Skip to content

Commit

Permalink
Fixing Linux build (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefano Jannuzzo committed Sep 19, 2019
1 parent 4f9706b commit 44fd522
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions plugins/sitoa/renderer/RenderInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limitations under the License.
************************************************************************************************************************************/

#ifdef _WINDOWS
#include <thread>
#endif

#include "common/ParamsCamera.h"
#include "common/Tools.h"
Expand Down Expand Up @@ -231,7 +233,11 @@ int CRenderInstance::RenderProgressiveScene(int displayArea)
aa_steps.insert(-1);

// calculate a good bucket size for the progressive passes so that the total number of buckets = CPU_cores * 2
#ifdef _WINDOWS
int numCores = std::thread::hardware_concurrency();
#else
int numCores = sysconf(_SC_NPROCESSORS_ONLN);
#endif
int progressiveBucketSize = AiMax(((int)sqrt(displayArea / (numCores*2))), bucket_size);

AtNode* options = AiUniverseGetOptions();
Expand Down
3 changes: 2 additions & 1 deletion plugins/sitoa/renderer/RendererOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1524,7 +1524,8 @@ void DeviceSelectionLogic(CustomProperty &in_cp)
for (LONG i=0; i<gpuDeviceCount; i++)
{
int gpuDevice = AiArrayGetUInt(gpuDeviceIdsArray, i);
CString deviceName = AiDeviceGetName(AI_DEVICE_TYPE_GPU, gpuDevice);
AtString dn = AiDeviceGetName(AI_DEVICE_TYPE_GPU, gpuDevice);
CString deviceName(dn.c_str());
int freeMemory = AiDeviceGetMemoryMB(AI_DEVICE_TYPE_GPU, gpuDevice, AI_DEVICE_MEMORY_FREE);
int totalMemory = AiDeviceGetMemoryMB(AI_DEVICE_TYPE_GPU, gpuDevice, AI_DEVICE_MEMORY_TOTAL);
deviceName += L" (Free: " + CString(freeMemory) + " MB, Total: " + CString(totalMemory) + " MB)";
Expand Down

0 comments on commit 44fd522

Please sign in to comment.