44#include "StandardColors.h"
98 virtual void Rename(
const std::string& name =
"") = 0;
161 virtual size_t size()
const =0;
165 {
return size() == 0; }
174 virtual std::string
GetText([[maybe_unused]]
size_t i)
176 return "(unimplemented)";
188 return StandardColors::colors[StandardColors::COLOR_ERROR];
307 void MarkTimestampsModifiedFromCpu()
313 void MarkTimestampsModifiedFromGpu()
322 MarkTimestampsModifiedFromCpu();
328 MarkTimestampsModifiedFromGpu();
383 virtual void Rename(
const std::string& name =
"")
override
386 m_samples.
SetName(std::string(
"UniformWaveform<") +
typeid(S).name() +
">.m_samples");
401 m_samples.
SetName(std::string(
"UniformWaveform<") +
typeid(S).name() +
">.m_samples");
421 virtual size_t size()
const override
478 virtual void Rename(
const std::string& name =
"")
override
482 m_samples.
SetName(std::string(
"UniformWaveform<") +
typeid(S).name() +
">.m_samples");
483 m_offsets.
SetName(std::string(
"SparseWaveform<") +
typeid(S).name() +
">.m_offsets");
484 m_durations.
SetName(std::string(
"SparseWaveform<") +
typeid(S).name() +
">.m_durations");
499 m_samples.
SetName(std::string(
"SparseWaveform<") +
typeid(S).name() +
">.m_samples");
500 m_offsets.
SetName(std::string(
"SparseWaveform<") +
typeid(S).name() +
">.m_offsets");
501 m_durations.
SetName(std::string(
"SparseWaveform<") +
typeid(S).name() +
">.m_durations");
543 virtual size_t size()
const override
593#pragma GCC diagnostic push
594#pragma GCC diagnostic ignored "-Wunused-function"
703{
return (GetOffset(wfm, i) * wfm->m_timescale) + wfm->m_triggerPhase; }
716{
return GetDuration(wfm, i) * wfm->m_timescale; }
753 return GetOffset(sparse, i);
755 return GetOffset(uniform, i);
761 return GetDuration(sparse, i);
763 return GetDuration(uniform, i);
868#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:863
void MarkModifiedFromCpu()
Marks the CPU-side copy of the buffer as modified.
Definition: AcceleratorBuffer.h:852
void PrepareForCpuAccess()
Prepares the buffer to be accessed from the CPU.
Definition: AcceleratorBuffer.h:877
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:832
void resize(size_t size)
Change the usable size of the container.
Definition: AcceleratorBuffer.h:457
void PrepareForGpuAccess(bool outputOnly=false)
Prepares the buffer to be accessed from the GPU.
Definition: AcceleratorBuffer.h:899
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:818
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:1083
void SetName(std::string name)
Sets the debug name for this buffer.
Definition: AcceleratorBuffer.h:1444
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:715
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:702
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