repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
timith/QuantumVk | quantumvk/vulkan/sync/semaphore_manager.hpp | <gh_stars>0
#pragma once
#include "quantumvk/vulkan/vulkan_headers.hpp"
#include <vector>
namespace Vulkan
{
class Device;
// Class that manages use and reuse of semaphores
// Identical to fence manager
class SemaphoreManager
{
public:
void Init(Device* device);
~SemaphoreManager();
VkSemaphore RequestCl... |
timith/QuantumVk | quantumvk/vulkan/images/image.cpp | <reponame>timith/QuantumVk<filename>quantumvk/vulkan/images/image.cpp
#include "image.hpp"
#include "quantumvk/vulkan/device.hpp"
#include "quantumvk/vulkan/memory/buffer.hpp"
using namespace std;
namespace Vulkan
{
ImageView::ImageView(Device* device_, VkImageView view_, VkImageView depth_, VkImageView stencil_, c... |
timith/QuantumVk | quantumvk/threading/thread_group.hpp | #pragma once
#include <condition_variable>
#include <mutex>
#include <thread>
#include <vector>
#include <queue>
#include <future>
#include <memory>
#include "quantumvk/utils/object_pool.hpp"
#include "quantumvk/utils/variant.hpp"
#include "quantumvk/utils/intrusive.hpp"
//Thread pool/task manager
namespace Quantu... |
timith/QuantumVk | quantumvk/vulkan/misc/quirks.hpp | <filename>quantumvk/vulkan/misc/quirks.hpp
#pragma once
namespace Vulkan
{
//Structs specifying various implementation quirks and work arounds.
struct ImplementationQuirks
{
bool instance_deferred_lights = true;
bool merge_subpasses = true;
bool use_transient_color = true;
bool use_transient_depth_stencil ... |
timith/QuantumVk | quantumvk/vulkan/images/sampler.hpp | #pragma once
#include "quantumvk/vulkan/misc/cookie.hpp"
#include "quantumvk/vulkan/vulkan_common.hpp"
#include "quantumvk/vulkan/vulkan_headers.hpp"
#include "quantumvk/utils/object_pool.hpp"
namespace Vulkan
{
enum class StockSampler
{
NearestClamp,
LinearClamp,
TrilinearClamp,
NearestWrap,
LinearWrap,... |
timith/QuantumVk | quantumvk/vulkan/command_buffer.hpp | <reponame>timith/QuantumVk<filename>quantumvk/vulkan/command_buffer.hpp
#pragma once
#include "vulkan_headers.hpp"
#include "vulkan_common.hpp"
#include <string.h>
#include "memory/buffer.hpp"
#include "memory/buffer_pool.hpp"
#include "images/image.hpp"
#include "images/sampler.hpp"
#include "sync/pipeline_event.... |
timith/QuantumVk | quantumvk/utils/timer.hpp | #pragma once
#include <cstdint>
namespace Util
{
//Frame timer
class FrameTimer
{
public:
FrameTimer();
void reset();
double frame();
double frame(double frame_time);
double get_elapsed() const;
double get_frame_time() const;
void enter_idle();
void leave_idle();
private:
int64_t start;
in... |
timith/QuantumVk | quantumvk/vulkan/misc/type_to_string.hpp | <filename>quantumvk/vulkan/misc/type_to_string.hpp
#pragma once
#include "quantumvk/vulkan/vulkan_headers.hpp"
#include <string>
namespace Vulkan
{
static inline const char* LayoutToString(VkImageLayout layout)
{
switch (layout)
{
case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL:
return "SHADER_READ_ONLY";
... |
timith/QuantumVk | quantumvk/vulkan/sync/event_manager.hpp | #pragma once
#include "quantumvk/vulkan/vulkan_headers.hpp"
#include <vector>
namespace Vulkan
{
class Device;
//Identical to fence manager
class EventManager
{
public:
void Init(Device* device);
~EventManager();
VkEvent RequestClearedEvent();
void RecycleEvent(VkEvent event);
private:
Device* devic... |
timith/QuantumVk | quantumvk/utils/retained_heap_data.hpp | #pragma once
#include "intrusive.hpp"
#include <cstdint>
namespace Util
{
//Represents data on the heap, contains a size and size bytes of data which are cleaned up when this goes out of scope
class HeapData : public IntrusivePtrEnabled<HeapData, std::default_delete<HeapData>, MultiThreadCounter>
{
public:
H... |
timith/QuantumVk | quantumvk/vulkan/wsi/wsi_timing.hpp | #pragma once
#include "quantumvk/vulkan/vulkan_headers.hpp"
#include <vector>
namespace Vulkan
{
enum class LatencyLimiter
{
None,
AdaptiveLowLatency,
IdealPipeline
};
struct WSITimingOptions
{
uint32_t swap_interval = 1;
LatencyLimiter latency_limiter = LatencyLimiter::None;
bool adaptive_swap_inte... |
timith/QuantumVk | quantumvk/vulkan/sync/fence_manager.cpp | <reponame>timith/QuantumVk
#include "fence_manager.hpp"
#include "quantumvk/vulkan/device.hpp"
namespace Vulkan
{
void FenceManager::Init(Device* device_)
{
device = device_;
table = &device->GetDeviceTable();
}
VkFence FenceManager::RequestClearedFence()
{
if (!fences.empty())
{
auto ret = fences.bac... |
timith/QuantumVk | quantumvk/threading/thread_id.hpp | #pragma once
//Contains a single thread id
namespace Vulkan
{
unsigned GetCurrentThreadIndex();
void register_thread_index(unsigned thread_index);
} |
timith/QuantumVk | quantumvk/extern_build/vma_build.cpp | #include "quantumvk/vulkan/vulkan_headers.hpp"
#define VMA_IMPLEMENTATION
#include <extern/VulkanMemoryAllocator/vk_mem_alloc.h> |
timith/QuantumVk | quantumvk/utils/compile_time_hash.hpp | <gh_stars>0
#pragma once
#include <cstdint>
namespace Util
{
#ifdef _MSC_VER
// MSVC generates bogus warnings here.
#pragma warning(disable: 4307)
#endif
//Hashers for constexprs
constexpr uint64_t fnv_iterate(uint64_t hash, uint8_t c)
{
return (hash * 0x100000001b3ull) ^ c;
}
template<size_t index>
const... |
timith/QuantumVk | quantumvk/vulkan/sync/pipeline_event.cpp | <reponame>timith/QuantumVk
#include "pipeline_event.hpp"
#include "quantumvk/vulkan/device.hpp"
namespace Vulkan
{
EventHolder::~EventHolder()
{
if (event)
{
if (internal_sync)
device->DestroyEventNolock(event);
else
device->DestroyEvent(event);
}
}
void EventHolderDeleter::operator()(Vulkan::... |
timith/QuantumVk | quantumvk/vulkan/graphics/shader.hpp | #pragma once
#include "quantumvk/utils/hash.hpp"
#include "quantumvk/utils/intrusive.hpp"
#include "quantumvk/utils/enum_cast.hpp"
#include "quantumvk/utils/object_pool.hpp"
#include "descriptor_set.hpp"
#include "quantumvk/vulkan/misc/cookie.hpp"
#include "quantumvk/vulkan/misc/limits.hpp"
#include "quantumvk/vulka... |
timith/QuantumVk | quantumvk/extern_build/spirv_cross_include.hpp | <filename>quantumvk/extern_build/spirv_cross_include.hpp
#pragma once
#include <extern/SPIRV-Cross/spirv_cross.hpp> |
timith/QuantumVk | quantumvk/vulkan/command_buffer.cpp | <reponame>timith/QuantumVk<filename>quantumvk/vulkan/command_buffer.cpp
#include "command_buffer.hpp"
#include "device.hpp"
#include "images/format.hpp"
#include <cstring>
namespace Vulkan
{
CommandBuffer::CommandBuffer(Device* device_, VkCommandBuffer cmd_, VkPipelineCache cache_, Type type_)
: device(device_)
... |
timith/QuantumVk | quantumvk/threading/thread_id.cpp | <gh_stars>0
#include "thread_id.hpp"
#include "quantumvk/utils/logging.hpp"
namespace Vulkan
{
static thread_local unsigned thread_id_to_index = ~0u;
unsigned GetCurrentThreadIndex()
{
auto ret = thread_id_to_index;
if (ret == ~0u)
{
QM_LOG_WARN("Thread does not exist in thread manager or is not the main thread... |
timith/QuantumVk | quantumvk/vulkan/memory/buffer_pool.hpp | #pragma once
#include "quantumvk/vulkan/vulkan_headers.hpp"
#include "quantumvk/utils/intrusive.hpp"
#include <vector>
#include <algorithm>
namespace Vulkan
{
//Forward declare device
class Device;
//Forward declare buffer
class Buffer;
//A suballocation into a BufferBlock
struct BufferBlockAllocation
{
uin... |
timith/QuantumVk | quantumvk/vulkan/wsi/wsi.cpp | <gh_stars>0
#include "wsi.hpp"
#include "quantumvk/vulkan/misc/quirks.hpp"
#include <thread>
using namespace std;
namespace Vulkan
{
WSI::WSI()
{
}
void WSIPlatform::SetWindowTitle(const string&)
{
}
uintptr_t WSIPlatform::GetFullscreenMonitor()
{
return 0;
}
void WSI::SetWindowTitle(const string& titl... |
timith/QuantumVk | quantumvk/vulkan/memory/buffer_pool.cpp | #include "buffer_pool.hpp"
#include "quantumvk/vulkan/device.hpp"
#include <utility>
using namespace std;
namespace Vulkan
{
void BufferPool::Init(Device* device_, VkDeviceSize block_size_,
VkDeviceSize alignment_, VkBufferUsageFlags usage_,
bool need_device_local_)
{
device = device_;
block_size = block_si... |
timith/QuantumVk | quantumvk/vulkan/sync/semaphore.hpp | <filename>quantumvk/vulkan/sync/semaphore.hpp
#pragma once
#include "quantumvk/vulkan/vulkan_common.hpp"
#include "quantumvk/vulkan/vulkan_headers.hpp"
#include "quantumvk/vulkan/misc/cookie.hpp"
#include "quantumvk/utils/object_pool.hpp"
namespace Vulkan
{
class Device;
class SemaphoreHolder;
struct SemaphoreHol... |
timith/QuantumVk | quantumvk/vulkan/sync/pipeline_event.hpp | #pragma once
#include "quantumvk/vulkan/vulkan_headers.hpp"
#include "quantumvk/vulkan/vulkan_common.hpp"
#include "quantumvk/vulkan/misc/cookie.hpp"
#include "quantumvk/utils/object_pool.hpp"
namespace Vulkan
{
class Device;
class EventHolder;
struct EventHolderDeleter
{
void operator()(EventHolder* event);
... |
timith/QuantumVk | quantumvk/vulkan/misc/limits.hpp | <gh_stars>0
#pragma once
/**
*Contains the minimum requirments for various settings in vulkan
*/
namespace Vulkan
{
constexpr unsigned VULKAN_NUM_DESCRIPTOR_SETS = 8;
constexpr unsigned VULKAN_NUM_BINDINGS = 16;
constexpr unsigned VULKAN_NUM_BINDINGS_BINDLESS_VARYING = 64 * 1024;
constexpr unsigned VULKAN_NUM_BIN... |
timith/QuantumVk | quantumvk/vulkan/vulkan_common.hpp | #pragma once
#include "quantumvk/utils/intrusive.hpp"
#include "quantumvk/utils/intrusive.hpp"
#include "quantumvk/utils/object_pool.hpp"
#include "quantumvk/utils/intrusive_object_pool.hpp"
#include "quantumvk/utils/intrusive_hash_map.hpp"
#include "quantumvk/utils/retained_alloc.hpp"
namespace Vulkan
{
#ifdef QM_V... |
timith/QuantumVk | quantumvk/vulkan/device_resources.cpp | <filename>quantumvk/vulkan/device_resources.cpp
#include "device.hpp"
#include "images/format.hpp"
#include <algorithm>
#include <string.h>
#include <stdlib.h>
#ifdef QM_VULKAN_MT
#define LOCK() std::lock_guard<std::mutex> holder__{lock.lock}
#else
#define LOCK() ((void)0)
#endif
using namespace Util;
namespace Vul... |
timith/QuantumVk | quantumvk/vulkan/images/texture_format.cpp | <reponame>timith/QuantumVk<filename>quantumvk/vulkan/images/texture_format.cpp<gh_stars>0
#include "texture_format.hpp"
#include "format.hpp"
#include <algorithm>
using namespace std;
namespace Vulkan
{
uint32_t TextureFormatLayout::NumMiplevels(uint32_t width, uint32_t height, uint32_t depth)
{
uint32_t size = u... |
timith/QuantumVk | quantumvk/utils/stack_allocator.hpp | <reponame>timith/QuantumVk<filename>quantumvk/utils/stack_allocator.hpp
#pragma once
#include <algorithm>
namespace Util
{
template <typename T, size_t N>
class StackAllocator
{
public:
//Allocates count objects from the stack and returns a pointer to them
T* allocate(size_t count)
{
if (count == 0)
... |
timith/QuantumVk | quantumvk/vulkan/sync/semaphore_manager.cpp | #include "semaphore_manager.hpp"
#include "quantumvk/vulkan/device.hpp"
namespace Vulkan
{
void SemaphoreManager::Init(Device* device_)
{
device = device_;
table = &device->GetDeviceTable();
}
SemaphoreManager::~SemaphoreManager()
{
for (auto& sem : semaphores)
table->vkDestroySemaphore(device->GetDevic... |
timith/QuantumVk | quantumvk/vulkan/sync/fence.cpp | <reponame>timith/QuantumVk<gh_stars>0
#include "fence.hpp"
#include "quantumvk/vulkan/device.hpp"
namespace Vulkan
{
FenceHolder::~FenceHolder()
{
if (fence != VK_NULL_HANDLE)
{
if (internal_sync)
device->ResetFenceNolock(fence, observed_wait);
else
device->ResetFence(fence, observed_wait);
}
}
... |
timith/QuantumVk | quantumvk/utils/variant.hpp | #pragma once
#include <memory>
#include <utility>
namespace Quantum
{
//Class that can hold one type at any one time.
class Variant
{
public:
Variant() = default;
template <typename T>
explicit Variant(T&& t)
{
set(std::forward<T>(t));
}
template <typename T>
void set(T&& t)
{
value = std:... |
timith/QuantumVk | quantumvk/vulkan/images/image.hpp | #pragma once
#include "format.hpp"
#include "quantumvk/vulkan/misc/cookie.hpp"
#include "quantumvk/vulkan/vulkan_common.hpp"
#include "quantumvk/vulkan/vulkan_headers.hpp"
#include "quantumvk/vulkan/memory/memory_allocator.hpp"
#include "quantumvk/utils/small_vector.hpp"
namespace Vulkan
{
//Forward declare devi... |
timith/QuantumVk | quantumvk/vulkan/memory/memory_allocator.cpp | <reponame>timith/QuantumVk
#include "memory_allocator.hpp"
#include "quantumvk/vulkan/device.hpp"
namespace Vulkan
{
void DeviceAllocator::Init(Device* device)
{
#ifdef QM_VULKAN_MT
std::lock_guard lock(m_mutex);
#endif
mem_props = device->GetMemoryProperties();
const VolkDeviceTable& table = device->GetDevi... |
timith/QuantumVk | quantumvk/utils/intrusive_hash_map.hpp | <filename>quantumvk/utils/intrusive_hash_map.hpp
#pragma once
#include "hash.hpp"
#include "intrusive_list.hpp"
#include "object_pool.hpp"
#include "read_write_lock.hpp"
#include <assert.h>
#include <vector>
namespace Util
{
template <typename T>
class IntrusiveHashMapEnabled : public IntrusiveListEnabled<T>
{
p... |
timith/QuantumVk | quantumvk/extern_build/vma_include.hpp | #pragma once
#include "quantumvk/vulkan/vulkan_headers.hpp"
#include <extern/VulkanMemoryAllocator/vk_mem_alloc.h> |
timith/QuantumVk | quantumvk/utils/hash.hpp | <gh_stars>0
#pragma once
#include <cstdint>
#include <string>
namespace Util
{
using Hash = uint64_t;
//Simple hasher class, able to hash, data, numerical values, pointers, and strings
class Hasher
{
public:
explicit Hasher(Hash h_)
: h(h_)
{
}
Hasher() = default;
template <typename T>
inline v... |
timith/QuantumVk | quantumvk/vulkan/misc/cookie.cpp | <filename>quantumvk/vulkan/misc/cookie.cpp
#include "cookie.hpp"
#include "quantumvk/vulkan/device.hpp"
namespace Vulkan
{
Cookie::Cookie(Device* device)
: cookie(device->AllocateCookie())
{
}
} |
timith/QuantumVk | quantumvk/vulkan/images/sampler.cpp | #include "sampler.hpp"
#include "quantumvk/vulkan/device.hpp"
namespace Vulkan
{
Sampler::Sampler(Device* device_, VkSampler sampler_, const SamplerCreateInfo& info)
: Cookie(device_)
, device(device_)
, sampler(sampler_)
, create_info(info)
{
}
Sampler::~Sampler()
{
if (sampler)
{
if (internal_s... |
timith/QuantumVk | quantumvk/vulkan/wsi/wsi.hpp | #pragma once
#include "quantumvk/utils/timer.hpp"
#include "quantumvk/vulkan/device.hpp"
#include "quantumvk/vulkan/vulkan_headers.hpp"
#include "quantumvk/vulkan/sync/semaphore_manager.hpp"
#include "wsi_timing.hpp"
#include <memory>
#include <vector>
namespace Vulkan
{
class WSI;
class WSIPlatform
{
public... |
timith/QuantumVk | quantumvk/vulkan/sync/fence_manager.hpp | <gh_stars>0
#pragma once
#include "quantumvk/vulkan/vulkan_headers.hpp"
#include <vector>
namespace Vulkan
{
class Device;
// Class that manages use and reuse of fences
// Just a linear allocator that stores every fence ever created
// If you request a fence it either returns a reused fence
// or creates a new o... |
timith/QuantumVk | quantumvk/extern_build/spirv_cross_build.cpp |
#include <extern/SPIRV-Cross/spirv_cross.cpp>
#include <extern/SPIRV-Cross/spirv_parser.cpp>
#include <extern/SPIRV-Cross/spirv_cross_parsed_ir.cpp>
#include <extern/SPIRV-Cross/spirv_cfg.cpp> |
timith/QuantumVk | quantumvk/vulkan/command_pool.cpp | <gh_stars>0
#include "command_pool.hpp"
#include "device.hpp"
namespace Vulkan
{
CommandPool::CommandPool(Device* device_, uint32_t queue_family_index)
: device(device_), table(&device_->GetDeviceTable())
{
VkCommandPoolCreateInfo info = { VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO };
info.flags = VK_COMMAND_P... |
timith/QuantumVk | quantumvk/utils/aligned_alloc.hpp | <reponame>timith/QuantumVk
#pragma once
#include <stddef.h>
#include <stdexcept>
#include <new>
namespace Util
{
//Allocs memory with an alignment.
void* memalign_alloc(size_t boundary, size_t size);
//Callocs memory with an alignment.
void* memalign_calloc(size_t boundary, size_t size);
//Frees m... |
timith/QuantumVk | quantumvk/vulkan/graphics/descriptor_set.hpp | <filename>quantumvk/vulkan/graphics/descriptor_set.hpp<gh_stars>0
#pragma once
#include "quantumvk/utils/hash.hpp"
#include "quantumvk/utils/object_pool.hpp"
#include "quantumvk/utils/intrusive.hpp"
#include "quantumvk/utils/intrusive_object_pool.hpp"
#include "quantumvk/utils/temporary_hashmap.hpp"
#include "quantum... |
timith/QuantumVk | quantumvk/vulkan/graphics/descriptor_set.cpp | #include "descriptor_set.hpp"
#include "quantumvk/vulkan/device.hpp"
#include <vector>
using namespace Util;
namespace Vulkan
{
///////////////////////////////////////////////////////////////
//Static inline helper functions///////////////////////////////
////////////////////////////////////////////////////////... |
timith/QuantumVk | quantumvk/vulkan/sync/fence.hpp | #pragma once
#include "quantumvk/vulkan/vulkan_headers.hpp"
#include "quantumvk/vulkan/vulkan_common.hpp"
#include "quantumvk/utils/object_pool.hpp"
#include "quantumvk/vulkan/misc/cookie.hpp"
#ifdef QM_VULKAN_MT
#include <mutex>
#endif
namespace Vulkan
{
class Device;
class FenceHolder;
struct FenceHolderDelet... |
timith/QuantumVk | quantumvk/vulkan/memory/buffer.cpp | #include "buffer.hpp"
#include "quantumvk/vulkan/device.hpp"
namespace Vulkan
{
Buffer::Buffer(Device* device_, VkBuffer buffer_, const DeviceAllocation& alloc_, const BufferCreateInfo& info_)
: Cookie(device_)
, device(device_)
, buffer(buffer_)
, alloc(alloc_)
, info(info... |
timith/QuantumVk | quantumvk/vulkan/images/texture_format.hpp | #pragma once
#include "quantumvk/vulkan/vulkan_headers.hpp"
#include <vector>
#include <cstddef>
#include <cassert>
//Various helpers for texture formats
namespace Vulkan
{
class TextureFormatLayout
{
public:
static uint32_t FormatBlockSize(VkFormat format, VkImageAspectFlags aspect);
static void FormatBloc... |
timith/QuantumVk | quantumvk/vulkan/images/format.hpp | #pragma once
#include "quantumvk/vulkan/vulkan_headers.hpp"
#include "texture_format.hpp"
//Various helpers for vkformat
namespace Vulkan
{
static inline bool format_is_srgb(VkFormat format)
{
switch (format)
{
case VK_FORMAT_A8B8G8R8_SRGB_PACK32:
case VK_FORMAT_R8G8B8A8_SRGB:
case VK_FORMAT_B8G8R8A8_SRG... |
timith/QuantumVk | quantumvk/utils/small_vector.hpp | <reponame>timith/QuantumVk<gh_stars>0
#pragma once
#include <stddef.h>
#include <stdlib.h>
#include <utility>
#include <exception>
#include <algorithm>
#include <initializer_list>
namespace Util
{
// std::aligned_storage does not support size == 0, so roll our own.
template <typename T, size_t N>
class AlignedBuff... |
timith/QuantumVk | quantumvk/extern_build/volk_build.cpp | #ifdef _WIN32
#define VK_USE_PLATFORM_WIN32_KHR
#endif
#include <extern/volk/volk.c> |
timith/QuantumVk | quantumvk/utils/temporary_hashmap.hpp | #pragma once
#include "hash.hpp"
#include "object_pool.hpp"
#include "intrusive_list.hpp"
#include "intrusive_hash_map.hpp"
#include <vector>
namespace Util
{
/**
* @brief Object must inheiret from this class to be used in the TemporaryHashmap
* @tparam T Object Type
*/
template <typename T>
class TemporaryHa... |
timith/QuantumVk | quantumvk/extern_build/volk_include.hpp | <filename>quantumvk/extern_build/volk_include.hpp
#pragma once
#ifdef _WIN32
#define VK_USE_PLATFORM_WIN32_KHR
#endif
#include <extern/volk/volk.h> |
timith/QuantumVk | quantumvk/vulkan/graphics/render_pass.cpp | #include "render_pass.hpp"
#include "quantumvk/utils/stack_allocator.hpp"
#include "quantumvk/vulkan/device.hpp"
#include "quantumvk/vulkan/misc/quirks.hpp"
#include <utility>
#include <cstring>
using namespace std;
using namespace Util;
#ifdef QM_VULKAN_MT
#define LOCK() std::lock_guard<std::mutex> holder__{lock}
... |
timith/QuantumVk | quantumvk/utils/enum_cast.hpp | <reponame>timith/QuantumVk<gh_stars>0
#pragma once
#include <type_traits>
namespace Util
{
template <typename T>
constexpr typename std::underlying_type<T>::type ecast(T x)
{
return static_cast<typename std::underlying_type<T>::type>(x);
}
} |
timith/QuantumVk | quantumvk/vulkan/graphics/shader.cpp | #include "shader.hpp"
#include "quantumvk/vulkan/device.hpp"
#include <quantumvk/extern_build/spirv_cross_include.hpp>
using namespace std;
using namespace spirv_cross;
using namespace Util;
namespace Vulkan
{
///////////////////////////////
//Pipeline Layout//////////////
///////////////////////////////
Progra... |
timith/QuantumVk | quantumvk/vulkan/device.cpp | <reponame>timith/QuantumVk
#include "device.hpp"
#include "images/format.hpp"
#include "misc/type_to_string.hpp"
#include "quantumvk/utils/timer.hpp"
#include <algorithm>
#include <string.h>
#include <stdlib.h>
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#ifdef QM_VULKAN_MT
#include "quan... |
timith/QuantumVk | quantumvk/utils/retained_alloc.hpp | <filename>quantumvk/utils/retained_alloc.hpp
#pragma once
#include <vector>
#include <mutex>
namespace Util
{
template<typename>
class RetainedDynamicArray;
class TypelessRetainedAlloc
{
public:
void* ptr;
size_t capacity;
};
// Vulkan uses a lot of arrays passed into functions as arguments. This struct... |
PhilippMueller1991/SIMD_Tests | Image.cpp | #include <iostream>
#include "Image.h"
void Image::SaveBitmap(std::string filename, const int w, const int h, float* data)
{
FILE* f;
unsigned char* img = NULL;
int filesize = 54 + 3 * w * h;
img = (unsigned char*)malloc(3 * w * h);
memset(img, 0, 3 * w * h);
int x, y;
for (int i = 0; i < w; i++)
{
for (... |
PhilippMueller1991/SIMD_Tests | Main.cpp | #include <iostream>
#include <string.h>
#include "InstructionSetLevel.h"
#include "NoiseRef.h"
#include "NoiseSSE.h"
#include "NoiseAVX2.h"
#include "NoiseCS.h"
#include "NoiseCL.h"
int iterations = 100;
int start = 16;
int end = 4096;
// Good read about the topic of optimization
// https://stackoverflow.com/quest... |
PhilippMueller1991/SIMD_Tests | NoiseCL.cpp | #include "NoiseCL.h"
#include <iostream>
#include <chrono>
#include "CL/cl.hpp"
#include "Image.h"
//http://simpleopencl.blogspot.com/2013/06/tutorial-simple-start-with-opencl-and-c.html
void NoiseCL::CreateImage(int width, int height, int iterations)
{
static bool first_call = true;
// Get all platforms (drivers... |
PhilippMueller1991/SIMD_Tests | NoiseSSE.cpp | <gh_stars>0
#include "NoiseSSE.h"
#include <iostream>
#include <math.h>
#include <chrono>
#include "Image.h"
#include "NoiseRef.h"
void NoiseSSE::CreateImage(int width, int height, int iterations)
{
//RunTests();
int widthSSE = width;
if (width % 2 != 0)
{
widthSSE++;
}
float* data = new float[widthSSE * he... |
PhilippMueller1991/SIMD_Tests | NoiseCS.cpp | #include "NoiseCS.h"
#include <iostream>
#include <math.h>
#include <chrono>
#include "Image.h"
void NoiseCS::CreateImage(int width, int height, int iterations)
{
const char* shader_source = " \
#version 430 \n\
#extension GL_ARB_compute_shader: enable ... |
PhilippMueller1991/SIMD_Tests | NoiseAVX2.cpp | <filename>NoiseAVX2.cpp
#include "NoiseAVX2.h"
#include <iostream>
#include <chrono>
#include "Image.h"
#include "NoiseRef.h"
void NoiseAVX2::CreateImage(int width, int height, int iterations)
{
int widthAVX = width;
if (width % 4 != 0)
{
widthAVX += width % 4;
}
float* data = new float[widthAVX * height];
... |
PhilippMueller1991/SIMD_Tests | NoiseRef.cpp | #include "NoiseRef.h"
#include <iostream>
#include <chrono>
#include <math.h>
#include "Image.h"
void NoiseRef::CreateImage(int width, int height, int iterations)
{
float* data = new float[width * height];
std::chrono::nanoseconds minTime = std::chrono::nanoseconds::max();
std::chrono::nanoseconds averageTime = s... |
critique-gaming/fuior | fuior_compiler/native_extension/src/extension.cpp | // Extension lib defines
#define EXTENSION_NAME fuior_compiler
#define LIB_NAME "fuior_compiler"
#define MODULE_NAME LIB_NAME
#include <dmsdk/sdk.h>
#include "fuior.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
static int compile(lua_State *L) {
const char *input = luaL_checkstring(L, 1);
co... |
t-cochran/CSPB-3308-Lab-4 | om_nom_nom.cpp | #include "include/basket.hpp"
int main(int argc, char* argv[])
{
/* Make some fruit! */
Fruit banana;
banana.name = "banana";
banana.color = "Yellow";
banana.rating = 5;
Fruit apple;
apple.name = "apple";
apple.color = "red";
apple.rating = 7;
Fruit mango;
mango.n... |
t-cochran/CSPB-3308-Lab-4 | include/basket.hpp | #ifndef BASKET
#define BASKET
#include <vector>
#include <string>
/*
* FRUIT!
*/
typedef struct
{
std::string name;
std::string color;
int rating;
} Fruit;
/*
* A delicious assortment of fruits
*/
class Fruit_Basket
{
private:
std::vector<Fruit> all_them_fruits;
public:
... |
t-cochran/CSPB-3308-Lab-4 | basket.cpp | #include "include/basket.hpp"
// Construct dat basket
Fruit_Basket::Fruit_Basket() {};
void::Fruit_Basket::push_fruit(Fruit name)
{
all_them_fruits.push_back(name);
}
// Consume a fruit of your choice
void::Fruit_Basket::gimme(std::string name)
{
for (std::vector<Fruit>::iterator it = all_them_fruits.begin()... |
JC2295/Embedded_Systems_Tutorials | Arduino/Photo_Resistor/src/main.cpp | #include <Arduino.h>
int voltageReadingPin = A0;
int voltageReading;
float convertedVoltageReading;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(voltageReadingPin, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
voltageReading = analogRead(volta... |
JC2295/Embedded_Systems_Tutorials | Arduino/Warning_Light/src/main.cpp | #include <Arduino.h>
int red = 7;
int green = 8;
int voltagePin = A0;
int voltage;
float convertedVoltage;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(red, OUTPUT);
pinMode(green, OUTPUT);
pinMode(voltagePin, INPUT);
}
void loop() {
// put your main code here, to r... |
JC2295/Embedded_Systems_Tutorials | Arduino/Buzzer_Tone_Controller/src/main.cpp | <reponame>JC2295/Embedded_Systems_Tutorials<gh_stars>0
#include <Arduino.h>
int voltageReadingPin = A0;
int voltageReading;
float voltageConverted;
int buzzerPin = 8;
float fDelay;
int iDelay;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(voltageReadingPin, INPUT);
pinMod... |
EdgarEscobedoHernandez/hub | hub/main.cpp | <filename>hub/main.cpp
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QApplication>
#include <QtWebEngine>
#include <QQuickStyle>
#include <QWebEngineProfile>
#include "filehandler.h"
#include "services.h"
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDp... |
EdgarEscobedoHernandez/hub | hub/filehandler.cpp | <filename>hub/filehandler.cpp
#include "filehandler.h"
#include <QFile>
#include <QUrl>
FileHandler::FileHandler(QObject *parent) : QObject(parent)
{
}
bool FileHandler::cleanWhatsappStorage(QString path)
{
QFile file;
return file.remove(path + "/Service Worker/Database/000003.log");
}
QString FileHandler::... |
ccoreilly/kaldi | src/nnet2bin/nnet-subset-egs.cc | <filename>src/nnet2bin/nnet-subset-egs.cc<gh_stars>0
// nnet2bin/nnet-subset-egs.cc
// Copyright 2012 Johns Hopkins University (author: <NAME>)
// Copyright 2014 <NAME>
// See ../../COPYING for clarification regarding multiple authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may... |
ccoreilly/kaldi | src/rnnlm/sampler.cc | // rnnlm/sampler.cc
// Copyright 2017 <NAME>
// See ../../COPYING for clarification regarding multiple authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.... |
ccoreilly/kaldi | src/util/parse-options-test.cc | // util/parse-options-test.cc
// Copyright 2009-2011 Microsoft Corporation
// Copyright 2012-2013 <NAME>; <NAME>
// Copyright 2013 <NAME>
// See ../../COPYING for clarification regarding multiple authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except... |
namishelex01/LeetCode-Solutions | C++/maximum-subarray.cpp | // Time: O(n)
// Space: O(1)
class Solution {
public:
int maxSubArray(vector<int>& nums) {
const auto& max_num = *max_element(nums.cbegin(), nums.cend());
if (max_num < 0) {
return max_num;
}
int global_max = 0, local_max = 0;
for (const auto &x : nums) {
... |
namishelex01/LeetCode-Solutions | C++/confusing-number.cpp | // Time: O(logn)
// Space: O(1)
class Solution {
public:
bool confusingNumber(int N) {
static const unordered_map<char, char> lookup =
{{'0', '0'}, {'1', '1'}, {'6', '9'},
{'8', '8'}, {'9', '6'}};
const auto& S = to_string(N);
for (int i = 0; i < S.length(); ++i... |
vdjagilev/serenity | Userland/DevTools/Profiler/TimelineTrack.cpp | <reponame>vdjagilev/serenity
/*
* Copyright (c) 2018-2021, <NAME> <<EMAIL>>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "TimelineTrack.h"
#include "Profile.h"
#include "TimelineView.h"
#include <LibGUI/Application.h>
#include <LibGUI/Painter.h>
#include <LibGfx/Palette.h>
namespace Profiler {
TimelineT... |
vdjagilev/serenity | Userland/Libraries/LibCpp/Preprocessor.cpp | <reponame>vdjagilev/serenity<gh_stars>0
/*
* Copyright (c) 2021, <NAME>. <<EMAIL>>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "Preprocessor.h"
#include <AK/Assertions.h>
#include <AK/GenericLexer.h>
#include <AK/StringBuilder.h>
#include <LibCpp/Lexer.h>
#include <ctype.h>
namespace Cpp {
Preprocessor:... |
vdjagilev/serenity | Kernel/FileSystem/ProcFS.cpp | /*
* Copyright (c) 2018-2021, <NAME> <<EMAIL>>
* Copyright (c) 2021, <NAME> <<EMAIL>>
* Copyright (c) 2021, <NAME>. <<EMAIL>>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/Singleton.h>
#include <Kernel/Debug.h>
#include <Kernel/FileSystem/Custody.h>
#include <Kernel/FileSystem/FileDescription.h>
#inc... |
a2609194449/Assistant-decision-making-system-for-gallbladder-cancer- | DicomWebStorge/Orthanc-1.7.4/OrthancServer/Sources/ServerJobs/Operations/SystemCallOperation.cpp | /**
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 <NAME>, Medical Physics
* Department, University Hospital of Liege, Belgium
* Copyright (C) 2017-2020 <NAME>., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Publ... |
a2609194449/Assistant-decision-making-system-for-gallbladder-cancer- | DicomWebStorge/Orthanc-1.7.4/OrthancFramework/UnitTestsSources/RestApiTests.cpp | <gh_stars>0
/**
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 <NAME>, Medical Physics
* Department, University Hospital of Liege, Belgium
* Copyright (C) 2017-2020 <NAME>., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU ... |
a2609194449/Assistant-decision-making-system-for-gallbladder-cancer- | DicomWebStorge/Orthanc-1.7.4/OrthancFramework/SharedLibrary/DllMain.cpp | /**
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 <NAME>, Medical Physics
* Department, University Hospital of Liege, Belgium
* Copyright (C) 2017-2020 <NAME>., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser Gener... |
a2609194449/Assistant-decision-making-system-for-gallbladder-cancer- | DicomWebStorge/Orthanc-1.7.4/OrthancFramework/Sources/HttpServer/StringHttpOutput.cpp | /**
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 <NAME>, Medical Physics
* Department, University Hospital of Liege, Belgium
* Copyright (C) 2017-2020 <NAME>., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser Gener... |
a2609194449/Assistant-decision-making-system-for-gallbladder-cancer- | DicomWebStorge/Orthanc-1.7.4/OrthancServer/Resources/Graveyard/DatabaseOptimizations/LookupResource.cpp | /**
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 <NAME>, Medical Physics
* Department, University Hospital of Liege, Belgium
* Copyright (C) 2017-2020 <NAME>., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Publ... |
a2609194449/Assistant-decision-making-system-for-gallbladder-cancer- | DicomWebStorge/Orthanc-1.7.4/OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp | /**
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 <NAME>, Medical Physics
* Department, University Hospital of Liege, Belgium
* Copyright (C) 2017-2020 <NAME>., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Publ... |
a2609194449/Assistant-decision-making-system-for-gallbladder-cancer- | DicomWebStorge/Orthanc-1.7.4/OrthancFramework/Sources/SharedLibrary.cpp | <filename>DicomWebStorge/Orthanc-1.7.4/OrthancFramework/Sources/SharedLibrary.cpp
/**
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 <NAME>, Medical Physics
* Department, University Hospital of Liege, Belgium
* Copyright (C) 2017-2020 <NAME>., Belgium
*
* This program is free software: y... |
a2609194449/Assistant-decision-making-system-for-gallbladder-cancer- | DicomWebStorge/Orthanc-1.7.4/OrthancFramework/Sources/HttpServer/HttpFileSender.cpp | /**
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 <NAME>, Medical Physics
* Department, University Hospital of Liege, Belgium
* Copyright (C) 2017-2020 <NAME>., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser Gener... |
a2609194449/Assistant-decision-making-system-for-gallbladder-cancer- | DicomWebStorge/Orthanc-1.7.4/OrthancFramework/Resources/CMake/WebAssembly/ArithmeticTests/Run2.cpp | <filename>DicomWebStorge/Orthanc-1.7.4/OrthancFramework/Resources/CMake/WebAssembly/ArithmeticTests/Run2.cpp<gh_stars>1-10
#include <iostream>
#include <emscripten/emscripten.h>
extern "C"
{
void EMSCRIPTEN_KEEPALIVE Run2()
{
// This stuff is not properly discovered by DCMTK 3.6.2 configuration scripts
std... |
a2609194449/Assistant-decision-making-system-for-gallbladder-cancer- | DicomWebStorge/Orthanc-1.7.4/OrthancServer/Plugins/Engine/PluginsEnumerations.cpp | <reponame>a2609194449/Assistant-decision-making-system-for-gallbladder-cancer-
/**
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 <NAME>, Medical Physics
* Department, University Hospital of Liege, Belgium
* Copyright (C) 2017-2020 <NAME>., Belgium
*
* This program is free software: you ... |
a2609194449/Assistant-decision-making-system-for-gallbladder-cancer- | DicomWebStorge/Orthanc-1.7.4/OrthancServer/UnitTestsSources/DatabaseLookupTests.cpp | /**
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 <NAME>, Medical Physics
* Department, University Hospital of Liege, Belgium
* Copyright (C) 2017-2020 <NAME>., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Publ... |
a2609194449/Assistant-decision-making-system-for-gallbladder-cancer- | DicomWebStorge/Orthanc-1.7.4/OrthancServer/Plugins/Engine/PluginsErrorDictionary.cpp | /**
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 <NAME>, Medical Physics
* Department, University Hospital of Liege, Belgium
* Copyright (C) 2017-2020 <NAME>., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Publ... |
a2609194449/Assistant-decision-making-system-for-gallbladder-cancer- | DicomWebStorge/Orthanc-1.7.4/OrthancFramework/Sources/DicomNetworking/Internals/MoveScp.cpp | <filename>DicomWebStorge/Orthanc-1.7.4/OrthancFramework/Sources/DicomNetworking/Internals/MoveScp.cpp
/**
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 <NAME>, Medical Physics
* Department, University Hospital of Liege, Belgium
* Copyright (C) 2017-2020 <NAME>., Belgium
*
* This program... |
a2609194449/Assistant-decision-making-system-for-gallbladder-cancer- | DicomWebStorge/Orthanc-1.7.4/OrthancFramework/Sources/DicomFormat/DicomInstanceHasher.cpp | /**
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 <NAME>, Medical Physics
* Department, University Hospital of Liege, Belgium
* Copyright (C) 2017-2020 <NAME>., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser Gener... |
a2609194449/Assistant-decision-making-system-for-gallbladder-cancer- | DicomWebStorge/Orthanc-1.7.4/OrthancServer/UnitTestsSources/VersionsTests.cpp | <reponame>a2609194449/Assistant-decision-making-system-for-gallbladder-cancer-
/**
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 <NAME>, Medical Physics
* Department, University Hospital of Liege, Belgium
* Copyright (C) 2017-2020 <NAME>., Belgium
*
* This program is free software: you ... |
a2609194449/Assistant-decision-making-system-for-gallbladder-cancer- | DicomWebStorge/Orthanc-1.7.4/OrthancFramework/UnitTestsSources/ImageTests.cpp | <filename>DicomWebStorge/Orthanc-1.7.4/OrthancFramework/UnitTestsSources/ImageTests.cpp
/**
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 <NAME>, Medical Physics
* Department, University Hospital of Liege, Belgium
* Copyright (C) 2017-2020 <NAME>., Belgium
*
* This program is free softw... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.