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];
325 void MarkTimestampsModifiedFromCpu()
331 void MarkTimestampsModifiedFromGpu()
340 MarkTimestampsModifiedFromCpu();
346 MarkTimestampsModifiedFromGpu();
401 virtual void Rename(
const std::string& name =
"")
override
404 m_samples.
SetName(std::string(
"UniformWaveform<") +
typeid(S).name() +
">.m_samples");
419 m_samples.
SetName(std::string(
"UniformWaveform<") +
typeid(S).name() +
">.m_samples");
442 virtual size_t size()
const override
499 virtual void Rename(
const std::string& name =
"")
override
503 m_samples.
SetName(std::string(
"SparseWaveform<") +
typeid(S).name() +
">.m_samples");
504 m_offsets.
SetName(std::string(
"SparseWaveform<") +
typeid(S).name() +
">.m_offsets");
505 m_durations.
SetName(std::string(
"SparseWaveform<") +
typeid(S).name() +
">.m_durations");
520 m_samples.
SetName(std::string(
"SparseWaveform<") +
typeid(S).name() +
">.m_samples");
521 m_offsets.
SetName(std::string(
"SparseWaveform<") +
typeid(S).name() +
">.m_offsets");
522 m_durations.
SetName(std::string(
"SparseWaveform<") +
typeid(S).name() +
">.m_durations");
582 virtual size_t size()
const override
632#pragma GCC diagnostic push
633#pragma GCC diagnostic ignored "-Wunused-function"
742{
return (GetOffset(wfm, i) * wfm->m_timescale) + wfm->m_triggerPhase; }
755{
return GetDuration(wfm, i) * wfm->m_timescale; }
792 return GetOffset(sparse, i);
794 return GetOffset(uniform, i);
800 return GetDuration(sparse, i);
802 return GetDuration(uniform, i);
907#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:905
void MarkModifiedFromCpu()
Marks the CPU-side copy of the buffer as modified.
Definition: AcceleratorBuffer.h:894
void PrepareForCpuAccess()
Prepares the buffer to be accessed from the CPU.
Definition: AcceleratorBuffer.h:919
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:874
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:941
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:860
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:1131
void SetName(std::string name)
Sets the debug name for this buffer.
Definition: AcceleratorBuffer.h:1497
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:754
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:741
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