Skip to content

Commit

Permalink
prepare a bug-fix release (#30)
Browse files Browse the repository at this point in the history
* clean gcc warnings
* bump the version
  • Loading branch information
Glavnokoman authored Jan 26, 2019
1 parent 9164794 commit 39e9076
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.8)
project(vuh VERSION 1.1.1)
project(vuh VERSION 1.1.2)

option(VUH_BUILD_BENCHMARKS "Build benchmarks for vuh library" OFF)
option(VUH_BUILD_DOCS "Build doxygen documentation for vuh" ON)
Expand Down
3 changes: 2 additions & 1 deletion doc/features_not_to_come.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Features NOT to come
This is to list the non-goals or things that are simply not achievable with a current approach
- Full-blown Vulkan wrapper - this is first and foremost GPGPU helper
- Reimplement some better-known GPGPU API (like Cuda or OpenCL) - the point is to provide an API which better reflects (and connects to) an underlying Vulkan structure and is more human friendly at the same time
- Library of compute shader primitives - worth of a separate project
- Dynamic parallelism - I do not see how it is doable in the Vulkan-SPIR-V framework.
- Dynamic parallelism - I do not see how it is doable in the Vulkan-SPIR-V framework
10 changes: 7 additions & 3 deletions src/include/vuh/arr/basicArray.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,15 @@ class BasicArray: public vk::Buffer {
return bool(_flags & vk::MemoryPropertyFlagBits::eHostVisible);
}

/// Move assignment. Resources associated with current array are released immidiately and not when moved from
/// object goes out of scope.
/// Move assignment.
/// Resources associated with current array are released immidiately (and not when moved from
/// object goes out of scope).
auto operator= (BasicArray&& other) noexcept-> BasicArray& {
release();
std::memcpy(this, &other, sizeof(BasicArray));
_mem = other._mem;
_flags = other._flags;
_dev = other._dev;
reinterpret_cast<vk::Buffer&>(*this) = reinterpret_cast<vk::Buffer&>(other);
reinterpret_cast<vk::Buffer&>(other) = nullptr;
return *this;
}
Expand Down
15 changes: 13 additions & 2 deletions src/include/vuh/program.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,21 @@ namespace vuh {
o._shader = nullptr; //
}

/// Move assignment.
/// Move assignment. Releases resources allocated for current instance before taking
/// ownership over those of the other instance.
ProgramBase& operator= (ProgramBase&& o) noexcept {
release();
std::memcpy(this, &o, sizeof(ProgramBase));
// member-wise copy
_shader = o._shader;
_dsclayout = o._dsclayout;
_dscpool = o._dscpool;
_dscset = o._dscset;
_pipecache = o._pipecache;
_pipelayout = o._pipelayout;
_pipeline = o._pipeline;
_device = o._device;
_batch = o._batch;

o._shader = nullptr;
return *this;
}
Expand Down
8 changes: 4 additions & 4 deletions test/performance/saxpy_b.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ namespace {
/// Benchmarked function.
/// Just run the kernel, assumes the data copied and kernel all set up.
/// This is supposed to be combined with FixCopyDataBindAll fixture.
auto saxpy(Program& program, const Params& p)-> void {
auto saxpy(Program& program, const Params& /*p*/)-> void {
program.run();
}

/// Set of parameters to run benchmakrs on.
static const auto params = std::vector<Params>({{32u, 2.f}, {128u, 2.f}, {1024u, 3.f}});
} // namespace

SLTBENCH_FUNCTION_WITH_FIXTURE_AND_ARGS(saxpy, FixDataHostVisible, params);
SLTBENCH_FUNCTION_WITH_FIXTURE_AND_ARGS(saxpy, FixCopyDataBindAll, params);
SLTBENCH_FUNCTION_WITH_FIXTURE_AND_ARGS(saxpy, FixDataHostVisible, params)
SLTBENCH_FUNCTION_WITH_FIXTURE_AND_ARGS(saxpy, FixCopyDataBindAll, params)

SLTBENCH_MAIN();
SLTBENCH_MAIN()

0 comments on commit 39e9076

Please sign in to comment.