File tree Expand file tree Collapse file tree 4 files changed +12
-4
lines changed
src/rmagine_embree/include/rmagine/simulation Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 1
1
#include " O1DnSimulatorEmbree.hpp"
2
2
#include < rmagine/simulation/SimulationResults.hpp>
3
3
#include < limits>
4
+ #include < omp.h>
4
5
5
6
#include " embree_common.h"
6
7
@@ -52,7 +53,7 @@ void O1DnSimulatorEmbree::simulate(
52
53
const float range_min = m_model->range .min ;
53
54
const float range_max = m_model->range .max ;
54
55
55
- #pragma omp parallel for
56
+ #pragma omp parallel for if(Tbm.size() >= omp_get_max_threads())
56
57
for (size_t pid = 0 ; pid < Tbm.size (); pid++)
57
58
{
58
59
const Transform Tbm_ = Tbm[pid];
@@ -63,6 +64,7 @@ void O1DnSimulatorEmbree::simulate(
63
64
64
65
const unsigned int glob_shift = pid * m_model->size ();
65
66
67
+ #pragma omp parallel for if(Tbm.size() < omp_get_max_threads())
66
68
for (unsigned int vid = 0 ; vid < m_model->getHeight (); vid++)
67
69
{
68
70
for (unsigned int hid = 0 ; hid < m_model->getWidth (); hid++)
Original file line number Diff line number Diff line change 1
1
#include " OnDnSimulatorEmbree.hpp"
2
2
#include < rmagine/simulation/SimulationResults.hpp>
3
3
#include < limits>
4
+ #include < omp.h>
4
5
5
6
#include " embree_common.h"
6
7
@@ -53,7 +54,7 @@ void OnDnSimulatorEmbree::simulate(
53
54
const float range_min = m_model->range .min ;
54
55
const float range_max = m_model->range .max ;
55
56
56
- #pragma omp parallel for
57
+ #pragma omp parallel for if(Tbm.size() >= omp_get_max_threads())
57
58
for (size_t pid = 0 ; pid < Tbm.size (); pid++)
58
59
{
59
60
const Transform Tbm_ = Tbm[pid];
@@ -64,6 +65,7 @@ void OnDnSimulatorEmbree::simulate(
64
65
65
66
const unsigned int glob_shift = pid * m_model->size ();
66
67
68
+ #pragma omp parallel for if(Tbm.size() < omp_get_max_threads())
67
69
for (unsigned int vid = 0 ; vid < m_model->getHeight (); vid++)
68
70
{
69
71
for (unsigned int hid = 0 ; hid < m_model->getWidth (); hid++)
Original file line number Diff line number Diff line change 1
1
#include " PinholeSimulatorEmbree.hpp"
2
2
#include < rmagine/simulation/SimulationResults.hpp>
3
3
#include < limits>
4
+ #include < omp.h>
4
5
5
6
#include " embree_common.h"
6
7
@@ -53,7 +54,7 @@ void PinholeSimulatorEmbree::simulate(
53
54
const float range_min = m_model->range .min ;
54
55
const float range_max = m_model->range .max ;
55
56
56
- #pragma omp parallel for
57
+ #pragma omp parallel for if(Tbm.size() >= omp_get_max_threads())
57
58
for (size_t pid = 0 ; pid < Tbm.size (); pid++)
58
59
{
59
60
const Transform Tbm_ = Tbm[pid];
@@ -64,6 +65,7 @@ void PinholeSimulatorEmbree::simulate(
64
65
65
66
const unsigned int glob_shift = pid * m_model->size ();
66
67
68
+ #pragma omp parallel for if(Tbm.size() < omp_get_max_threads())
67
69
for (unsigned int vid = 0 ; vid < m_model->getHeight (); vid++)
68
70
{
69
71
for (unsigned int hid = 0 ; hid < m_model->getWidth (); hid++)
Original file line number Diff line number Diff line change 1
1
#include " SphereSimulatorEmbree.hpp"
2
2
#include < rmagine/simulation/SimulationResults.hpp>
3
3
#include < limits>
4
+ #include < omp.h>
4
5
5
6
#include " embree_common.h"
6
7
@@ -54,7 +55,7 @@ void SphereSimulatorEmbree::simulate(
54
55
const float range_max = m_model->range .max ;
55
56
56
57
57
- // #pragma omp parallel for
58
+ #pragma omp parallel for if(Tbm.size() >= omp_get_max_threads())
58
59
for (size_t pid = 0 ; pid < Tbm.size (); pid++)
59
60
{
60
61
const Transform Tbm_ = Tbm[pid];
@@ -65,6 +66,7 @@ void SphereSimulatorEmbree::simulate(
65
66
66
67
const unsigned int glob_shift = pid * m_model->size ();
67
68
69
+ #pragma omp parallel for if(Tbm.size() < omp_get_max_threads())
68
70
for (unsigned int vid = 0 ; vid < m_model->getHeight (); vid++)
69
71
{
70
72
for (unsigned int hid = 0 ; hid < m_model->getWidth (); hid++)
You can’t perform that action at this time.
0 commit comments