Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add the comment and version of dcurl API #115

Merged
merged 1 commit into from
Feb 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated files
build/
docs/html

# Object files
*.o
Expand Down
32 changes: 32 additions & 0 deletions Doxyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "dcurl"
PROJECT_NUMBER = 0.1.0
OUTPUT_DIRECTORY = docs
OPTIMIZE_OUTPUT_FOR_C = YES
#---------------------------------------------------------------------------
# Configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = YES
#---------------------------------------------------------------------------
# Configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = . \
docs \
src
FILE_PATTERNS = dcurl.c \
dcurl.h \
marktwtn marked this conversation as resolved.
Show resolved Hide resolved
*.md
USE_MDFILE_AS_MAINPAGE = README.md
#---------------------------------------------------------------------------
# Configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = YES
INLINE_SOURCES = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
#---------------------------------------------------------------------------
# Configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![Build Status](https://travis-ci.org/DLTcollab/dcurl.svg?branch=dev)](https://travis-ci.org/DLTcollab/dcurl)
![Supported IRI version](https://img.shields.io/badge/Supported%20IRI%20Version-1.6.0-brightgreen.svg)
![Release version](https://img.shields.io/github/release-pre/DLTcollab/dcurl.svg)

Hardware-accelerated implementation for IOTA PearlDiver, which utilizes multi-threaded SIMD, FPGA and GPU.

Expand Down
4 changes: 4 additions & 0 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#include <stdint.h>
#include <time.h>

#define __DCURL_MAJOR__ 0
#define __DCURL_MINOR__ 1
#define __DCURL_PATCH__ 0

double diff_in_second(struct timespec t1, struct timespec t2);

typedef struct _pow_info PoW_Info;
Expand Down
43 changes: 43 additions & 0 deletions src/dcurl.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,51 @@
#include <stdbool.h>
#include "trinary.h"

/**
* @file dcurl.h
* @brief dcurl API functions.
*
* dcurl is a hardware-accelerated implementation for IOTA PearlDiver.
* It supports multi-threaded SIMD on CPU, OpenCL on GPU and FPGA to
* make a faster proof-of-work(PoW) for IOTA.
* The API functions can be used to initialize, execute and destroy dcurl
* easily.
*/
marktwtn marked this conversation as resolved.
Show resolved Hide resolved

/**
* @brief dcurl initialization.
*
* Register the determined hardware into the list and initialize the
* corresponding resource.
* @return
* - true: initialization succeeded.
* - false: initialization failed.
*/
bool dcurl_init();

/**
* @brief dcurl destruction.
*
* Remove the registered hardware from the list and release the corresponding
* resource.
*/
void dcurl_destroy();

/**
* @brief dcurl execution.
*
* Retrieve the available hardware from the list and use it to do the
* PoW(Proof-of-Work).
* @param [in] trytes The trytes for PoW calculation.
* @param [in] mwm The minimum weight magnitude.
* @param [in] threads
* @parblock
* The thread number of calculating the PoW. It affects CPU only.
*
* 0: use (maximum threads - 1).
* @endparblock
* @return The result of PoW.
*/
int8_t *dcurl_entry(int8_t *trytes, int mwm, int threads);

#endif