Skip to content

Commit

Permalink
Saving current progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Dec 24, 2024
1 parent 0130088 commit 6498c4f
Show file tree
Hide file tree
Showing 17 changed files with 377 additions and 532 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
endif ()

if(DEFINED CMAKE_BUILD_TYPE)
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -ggdb")
set(BOOST_FORCEINLINE "OFF") # improves debugging traces
endif()
#if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -ggdb")
#set(BOOST_FORCEINLINE "OFF") # improves debugging traces
#endif()
endif()

option(SANITIZE "Build sanitizers" FALSE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ namespace nil {
}
}

/*if (!fft_cache) {
if (!fft_cache) {
create_fft_cache();
}*/
detail::basic_radix2_fft_cached<FieldType>(a, omega);
}
detail::basic_radix2_fft_cached<FieldType>(a, fft_cache->first);
}

void inverse_fft(std::vector<value_type> &a) override {
Expand All @@ -101,10 +101,10 @@ namespace nil {
}
}

/*if (!fft_cache) {
if (!fft_cache) {
create_fft_cache();
}*/
detail::basic_radix2_fft_cached<FieldType>(a, omega.inversed());
}
detail::basic_radix2_fft_cached<FieldType>(a, fft_cache->second);

const field_value_type sconst = field_value_type(a.size()).inversed();
for (std::size_t i = 0; i < a.size(); ++i) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ namespace nil::crypto3::multiprecision {
// Assignment

template<typename T,
std::enable_if_t<std::is_integral_v<T> && std::is_unsigned_v<T>, int> = 0>
std::enable_if_t<std::is_integral_v<T> && std::is_unsigned_v<T> || std::is_same_v<T, unsigned __int128>, int> = 0>
constexpr void do_assign_integral(const T& a) noexcept {
if constexpr (sizeof(T) <= sizeof(limb_type)) {
this->limbs()[0] = a;
Expand Down Expand Up @@ -209,7 +209,7 @@ namespace nil::crypto3::multiprecision {
}

template<typename T,
std::enable_if_t<std::is_integral_v<T> && std::is_unsigned_v<T>, int> = 0>
std::enable_if_t<std::is_integral_v<T> && std::is_unsigned_v<T> || std::is_same_v<T, unsigned __int128>, int> = 0>
constexpr big_uint& operator=(T val) noexcept {
do_assign_integral(val);
return *this;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#if defined(__SIZEOF_INT128__)
#define NIL_CO3_MP_HAS_INT128
#endif
//#if defined(__SIZEOF_INT128__)
//#define NIL_CO3_MP_HAS_INT128
//#endif

// same again for __int128:
#if defined(NIL_CO3_MP_HAS_INT128) && defined(__cplusplus)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "nil/crypto3/multiprecision/detail/helper_macros.hpp"
#include "nil/crypto3/multiprecision/detail/int128.hpp"

#if __has_include(<immintrin.h>)
/*#if __has_include(<immintrin.h>)
#define NIL_CO3_MP_HAS_IMMINTRIN_H
Expand Down Expand Up @@ -53,4 +53,4 @@ namespace nil::crypto3::multiprecision::detail {
#endif
#endif
#endif*/
5 changes: 5 additions & 0 deletions gpu_gpustat_monitor.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

while true; do
gpustat --json >> gpu_utilization_gpustat_log.json
done
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,17 @@ namespace nil {
The function get_evaluation_domain is chosen from different supported domains,
depending on MinSize.
*/
template<typename FieldType, typename ValueType = typename FieldType::value_type,
typename Allocator = std::allocator<ValueType>>
std::shared_ptr<evaluation_domain<FieldType, ValueType, Allocator>> make_evaluation_domain(std::size_t m) {
template<typename FieldType, typename ValueType = typename FieldType::value_type>
std::shared_ptr<evaluation_domain<FieldType, ValueType>> make_evaluation_domain(std::size_t m) {

typedef std::shared_ptr<evaluation_domain<FieldType, ValueType, Allocator>> result_type;
typedef std::shared_ptr<evaluation_domain<FieldType, ValueType>> result_type;

const std::size_t big = 1ul << (std::size_t(std::ceil(std::log2(m))) - 1);
const std::size_t rounded_small = (1ul << std::size_t(std::ceil(std::log2(m - big))));

if (detail::is_basic_radix2_domain<FieldType>(m)) {
result_type result;
result.reset(new basic_radix2_domain<FieldType, ValueType, Allocator>(m));
result.reset(new basic_radix2_domain<FieldType, ValueType>(m));
return result;
}

Expand All @@ -135,7 +134,7 @@ namespace nil {

if (detail::is_basic_radix2_domain<FieldType>(big + rounded_small)) {
result_type result;
result.reset(new basic_radix2_domain<FieldType, ValueType, Allocator>(big + rounded_small));
result.reset(new basic_radix2_domain<FieldType, ValueType>(big + rounded_small));
return result;
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,11 @@ namespace nil {

using namespace nil::crypto3::algebra;

template<typename FieldType, typename ValueType, typename Allocator>
template<typename FieldType, typename ValueType>
class evaluation_domain;

template<typename FieldType, typename ValueType = typename FieldType::value_type,
typename Allocator = std::allocator<ValueType>>
class arithmetic_sequence_domain : public evaluation_domain<FieldType, ValueType, Allocator> {
template<typename FieldType, typename ValueType = typename FieldType::value_type>
class arithmetic_sequence_domain : public evaluation_domain<FieldType, ValueType> {
typedef typename FieldType::value_type field_value_type;
typedef ValueType value_type;

Expand Down
Loading

0 comments on commit 6498c4f

Please sign in to comment.