44#include "StandardColors.h"
99 virtual void Rename(
const std::string& name =
"") = 0;
168 virtual size_t size()
const =0;
178 {
return size() == 0; }
189 return "(unimplemented)";
201 return StandardColors::colors[StandardColors::COLOR_ERROR];
346 void MarkTimestampsModifiedFromCpu()
352 void MarkTimestampsModifiedFromGpu()
361 MarkTimestampsModifiedFromCpu();
367 MarkTimestampsModifiedFromGpu();
422 virtual void Rename(
const std::string& name =
"")
override
425 m_samples.SetName(std::string(
"UniformWaveform<") +
typeid(
S).name() +
">.m_samples");
440 m_samples.SetName(std::string(
"UniformWaveform<") +
typeid(
S).name() +
">.m_samples");
466 virtual size_t size()
const override
482 {
m_samples.PrepareForCpuAccessNonblocking(cmdBuf); }
485 {
m_samples.PrepareForGpuAccessNonblocking(
false, cmdBuf); }
532 virtual void Rename(
const std::string& name =
"")
override
536 m_samples.SetName(std::string(
"SparseWaveform<") +
typeid(
S).name() +
">.m_samples");
537 m_offsets.SetName(std::string(
"SparseWaveform<") +
typeid(
S).name() +
">.m_offsets");
538 m_durations.SetName(std::string(
"SparseWaveform<") +
typeid(
S).name() +
">.m_durations");
553 m_samples.SetName(std::string(
"SparseWaveform<") +
typeid(
S).name() +
">.m_samples");
554 m_offsets.SetName(std::string(
"SparseWaveform<") +
typeid(
S).name() +
">.m_offsets");
555 m_durations.SetName(std::string(
"SparseWaveform<") +
typeid(
S).name() +
">.m_durations");
615 virtual size_t size()
const override
640 m_samples.PrepareForCpuAccessNonblocking(cmdBuf);
641 m_offsets.PrepareForCpuAccessNonblocking(cmdBuf);
642 m_durations.PrepareForCpuAccessNonblocking(cmdBuf);
654 m_samples.PrepareForGpuAccessNonblocking(
false, cmdBuf);
655 m_offsets.PrepareForGpuAccessNonblocking(
false, cmdBuf);
656 m_durations.PrepareForGpuAccessNonblocking(
false, cmdBuf);
672 m_offsets.SetGpuAccessHint(
static_cast<AcceleratorBuffer<int64_t>::UsageHint
>(
hint));
673 m_durations.SetGpuAccessHint(
static_cast<AcceleratorBuffer<int64_t>::UsageHint
>(
hint));
732#pragma GCC diagnostic push
733#pragma GCC diagnostic ignored "-Wunused-function"
769{
return wfm->m_samples[
i] *
i; }
779{
return wfm->m_samples[
i] *
wfm->m_offsets[
i]; }
792{
return wfm->m_offsets[
i]; }
817{
return wfm->m_durations[
i]; }
842{
return (GetOffset(
wfm,
i) *
wfm->m_timescale) +
wfm->m_triggerPhase; }
855{
return GetDuration(
wfm,
i) *
wfm->m_timescale; }
1013#pragma GCC diagnostic pop
Declaration of AcceleratorBuffer.
Declaration of AlignedAllocator.
size_t capacity() const
Returns the allocated size of the container.
Definition AcceleratorBuffer.h:290
size_t size() const
Returns the actual size of the container (may be smaller than what was allocated)
Definition AcceleratorBuffer.h:286
Definition AcceleratorBuffer.h:204
A buffer of memory which may be used by GPU acceleration.
Definition AcceleratorBuffer.h:343
size_t GetMemoryBytes() const
Returns the total size of the buffer (wherever it is), in bytes.
Definition AcceleratorBuffer.h:582
void reserve(size_t size)
Reallocates buffers so that at least size elements of storage are available.
Definition AcceleratorBuffer.h:709
bool HasGpuBuffer() const
Returns true if there is currently a GPU-side buffer.
Definition AcceleratorBuffer.h:634
void clear()
Resize the container to be empty (but don't free memory)
Definition AcceleratorBuffer.h:703
void resize(size_t size, bool exactSize=false)
Change the usable size of the container.
Definition AcceleratorBuffer.h:679
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:854
std::optional< uint64_t > GetDigitalBusValueAtTime(WaveformBase *waveform, int64_t time_fs)
Gets the value of our channel at the specified timestamp (absolute, not waveform ticks).
Definition Waveform.cpp:230
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:255
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:841
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