Skip to content

Commit

Permalink
Merge branch 'gh-pages' of https://github.com/GollyGang/ready into gh…
Browse files Browse the repository at this point in the history
…-pages
  • Loading branch information
timhutton committed Jan 21, 2021
2 parents 1a7def0 + e6b0119 commit 5a0344a
Show file tree
Hide file tree
Showing 15 changed files with 487 additions and 150 deletions.
15 changes: 15 additions & 0 deletions src/gui/InfoPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const wxString InfoPanel::formula_label = _("Formula");
const wxString InfoPanel::kernel_label = _("Kernel");
const wxString InfoPanel::dimensions_label = _("Dimensions");
const wxString InfoPanel::block_size_label = _("Block size");
const wxString InfoPanel::use_local_memory_label = _("Use local memory");
const wxString InfoPanel::number_of_cells_label = _("Number of cells");
const wxString InfoPanel::wrap_label = _("Toroidal wrap-around");
const wxString InfoPanel::data_type_label = _("Data type");
Expand Down Expand Up @@ -191,6 +192,8 @@ void InfoPanel::Update(const AbstractRD& system)
system.GetBlockSizeX(),system.GetBlockSizeY(),system.GetBlockSizeZ()),
system.HasEditableBlockSize());

contents += AppendRow(use_local_memory_label, use_local_memory_label, system.GetUseLocalMemory() ? _("true") : _("false"), true);

if (system.HasEditableWrapOption())
contents += AppendRow(wrap_label, wrap_label, system.GetWrap() ? _("on") : _("off"), true);

Expand Down Expand Up @@ -636,6 +639,15 @@ void InfoPanel::ChangeBlockSize()

// -----------------------------------------------------------------------------

void InfoPanel::ChangeUseLocalMemory()
{
AbstractRD& sys = frame->GetCurrentRDSystem();
sys.SetUseLocalMemory(!sys.GetUseLocalMemory());
this->Update(sys);
}

// -----------------------------------------------------------------------------

void InfoPanel::ChangeWrapOption()
{
AbstractRD& sys = frame->GetCurrentRDSystem();
Expand Down Expand Up @@ -683,6 +695,9 @@ void InfoPanel::ChangeInfo(const wxString& label)
} else if ( label == block_size_label ) {
ChangeBlockSize();

} else if ( label == use_local_memory_label ) {
ChangeUseLocalMemory();

} else if ( label == wrap_label ) {
ChangeWrapOption();

Expand Down
2 changes: 2 additions & 0 deletions src/gui/InfoPanel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class InfoPanel : public wxPanel
static const wxString kernel_label;
static const wxString dimensions_label;
static const wxString block_size_label;
static const wxString use_local_memory_label;
static const wxString number_of_cells_label;
static const wxString wrap_label;
static const wxString data_type_label;
Expand All @@ -106,6 +107,7 @@ class InfoPanel : public wxPanel
void ChangeFormula();
void ChangeDimensions();
void ChangeBlockSize();
void ChangeUseLocalMemory();
void ChangeWrapOption();
void ChangeDataType();

Expand Down
2 changes: 1 addition & 1 deletion src/gui/frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3047,7 +3047,7 @@ void MyFrame::OnViewFullKernel(wxCommandEvent& event)

void MyFrame::OnUpdateViewFullKernel(wxUpdateUIEvent& event)
{
event.Enable(this->system->GetRuleType()=="formula");
event.Enable(true);// this->system->GetRuleType() == "formula");
}

// ---------------------------------------------------------------------
Expand Down
12 changes: 6 additions & 6 deletions src/readybase/AbstractRD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ using namespace std;
AbstractRD::AbstractRD(int data_type)
: x_spacing_proportion(0.05)
, y_spacing_proportion(0.1)
, use_local_memory(false)
, timesteps_taken(0)
, need_reload_formula(true)
, is_modified(false)
, wrap(true)
, neighborhood_type(TNeighborhood::VERTEX_NEIGHBORS)
{
this->timesteps_taken = 0;
this->need_reload_formula = true;
this->is_modified = false;
this->wrap = true;
this->InternalSetDataType(data_type);

this->neighborhood_type = TNeighborhood::VERTEX_NEIGHBORS;

#if defined(USE_SSE)
// disable accurate handling of denormals and zeros, for speed
#if (defined(__i386__) || defined(__x64_64__) || defined(__amd64__) || defined(_M_X64) || defined(_M_IX86))
Expand Down
4 changes: 4 additions & 0 deletions src/readybase/AbstractRD.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ class AbstractRD
virtual void SetBlockSizeY(int n) {}
virtual void SetBlockSizeZ(int n) {}

bool GetUseLocalMemory() const { return this->use_local_memory; }
void SetUseLocalMemory(bool val) { this->use_local_memory = val; this->need_reload_formula = true; }

virtual bool HasEditableWrapOption() const { return false; }
bool GetWrap() const { return this->wrap; }
virtual void SetWrap(bool w) { this->wrap = w; }
Expand Down Expand Up @@ -195,6 +198,7 @@ class AbstractRD
size_t data_type_size;
std::string data_type_string;
std::string data_type_suffix;
bool use_local_memory;

InitialPatternGenerator initial_pattern_generator;

Expand Down
Loading

0 comments on commit 5a0344a

Please sign in to comment.