44#include "StandardColors.h"
98 virtual void Rename(
const std::string& name =
"") = 0;
167 virtual size_t size()
const =0;
171 {
return size() == 0; }
180 virtual std::string
GetText([[maybe_unused]]
size_t i)
182 return "(unimplemented)";
194 return StandardColors::colors[StandardColors::COLOR_ERROR];
313 void MarkTimestampsModifiedFromCpu()
319 void MarkTimestampsModifiedFromGpu()
328 MarkTimestampsModifiedFromCpu();
334 MarkTimestampsModifiedFromGpu();
389 virtual void Rename(
const std::string& name =
"")
override
392 m_samples.
SetName(std::string(
"UniformWaveform<") +
typeid(S).name() +
">.m_samples");
407 m_samples.
SetName(std::string(
"UniformWaveform<") +
typeid(S).name() +
">.m_samples");
430 virtual size_t size()
const override
487 virtual void Rename(
const std::string& name =
"")
override
491 m_samples.
SetName(std::string(
"UniformWaveform<") +
typeid(S).name() +
">.m_samples");
492 m_offsets.
SetName(std::string(
"SparseWaveform<") +
typeid(S).name() +
">.m_offsets");
493 m_durations.
SetName(std::string(
"SparseWaveform<") +
typeid(S).name() +
">.m_durations");
508 m_samples.
SetName(std::string(
"SparseWaveform<") +
typeid(S).name() +
">.m_samples");
509 m_offsets.
SetName(std::string(
"SparseWaveform<") +
typeid(S).name() +
">.m_offsets");
510 m_durations.
SetName(std::string(
"SparseWaveform<") +
typeid(S).name() +
">.m_durations");
559 virtual size_t size()
const override
609#pragma GCC diagnostic push
610#pragma GCC diagnostic ignored "-Wunused-function"
719{
return (GetOffset(wfm, i) * wfm->m_timescale) + wfm->m_triggerPhase; }
732{
return GetDuration(wfm, i) * wfm->m_timescale; }
769 return GetOffset(sparse, i);
771 return GetOffset(uniform, i);
777 return GetDuration(sparse, i);
779 return GetDuration(uniform, i);
884#pragma GCC diagnostic pop
Declaration of AcceleratorBuffer.
Declaration of AlignedAllocator.
void MarkModifiedFromGpu()
Marks the GPU-side copy of the buffer as modified.
Definition: AcceleratorBuffer.h:895
void MarkModifiedFromCpu()
Marks the CPU-side copy of the buffer as modified.
Definition: AcceleratorBuffer.h:884
void PrepareForCpuAccess()
Prepares the buffer to be accessed from the CPU.
Definition: AcceleratorBuffer.h:909
void SetGpuAccessHint(UsageHint hint, bool reallocateImmediately=false)
Sets a hint to the buffer on how often we expect to use it on the GPU in the future.
Definition: AcceleratorBuffer.h:864
void resize(size_t size)
Change the usable size of the container.
Definition: AcceleratorBuffer.h:457
void reserve(size_t size)
Reallocates buffers so that at least size elements of storage are available.
Definition: AcceleratorBuffer.h:484
void PrepareForGpuAccess(bool outputOnly=false)
Prepares the buffer to be accessed from the GPU.
Definition: AcceleratorBuffer.h:931
void SetCpuAccessHint(UsageHint hint, bool reallocateImmediately=false)
Sets a hint to the buffer on how often we expect to use it on the CPU in the future.
Definition: AcceleratorBuffer.h:850
bool HasGpuBuffer() const
Returns true if there is currently a GPU-side buffer.
Definition: AcceleratorBuffer.h:415
void FreeGpuBuffer(bool dataLossOK=false)
Free the GPU-side buffer and underlying physical memory.
Definition: AcceleratorBuffer.h:1121
void SetName(std::string name)
Sets the debug name for this buffer.
Definition: AcceleratorBuffer.h:1487
void clear()
Resize the container to be empty (but don't free memory)
Definition: AcceleratorBuffer.h:478
std::optional< bool > GetDigitalValueAtTime(WaveformBase *waveform, int64_t time_fs)
Gets the value of our channel at the specified timestamp (absolute, not waveform ticks).
Definition: Waveform.cpp:200
int64_t GetDurationScaled(T *wfm, size_t i)
Returns the duration of a sample, in X axis units.
Definition: Waveform.h:731
std::optional< std::string > GetProtocolValueAtTime(WaveformBase *waveform, int64_t time_fs)
Gets the value of our channel at the specified timestamp (absolute, not waveform ticks).
Definition: Waveform.cpp:230
size_t GetIndexNearestAtOrBeforeTimestamp(WaveformBase *wfm, int64_t time_fs, bool &out_of_bounds)
Find the index of the sample in a (possibly sparse) waveform that COULD include the time time_fs.
Definition: Waveform.cpp:94
size_t BinarySearchForGequal(T *buf, size_t len, T value)
Look for a value greater than or equal to "value" in buf and return the index.
Definition: Waveform.cpp:44
int64_t GetOffsetScaled(T *wfm, size_t i)
Returns the offset of a sample from the start of the waveform, in X axis units.
Definition: Waveform.h:718
std::optional< float > GetValueAtTime(WaveformBase *waveform, int64_t time_fs, bool zero_hold_behavior)
Gets the value of our channel at the specified timestamp (absolute, not waveform ticks) and interpola...
Definition: Waveform.cpp:159