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

Add C# wrapper #60

Merged
merged 40 commits into from
Jun 19, 2019
Merged

Add C# wrapper #60

merged 40 commits into from
Jun 19, 2019

Conversation

MaggieQi
Copy link
Member

@MaggieQi MaggieQi commented Jun 3, 2019

No description provided.

@MaggieQi MaggieQi requested a review from AlphardWang June 3, 2019 12:39
std::unique_ptr<BasicResult[]> m_results;

std::unique_ptr<ByteArray[]> m_metadatas;
std::shared_ptr<BasicResult> m_results;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you do need a shared_array, maybe it is better to convert ByteArray into a template

struct WrapperArray
{
void * _data;
size_t _size;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please always use space instead of tab

{
std::copy(p_other.m_metadatas.get(), p_other.m_metadatas.get() + m_resultNum, m_metadatas.get());
}
std::memcpy(m_results.Data(), p_other.m_results.Data(), sizeof(BasicResult) * m_resultNum);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BasicResult is not POD, please use std::copy instead of memcpy

Copy link
Contributor

@AlphardWang AlphardWang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not familiar with swig with C#, please carefully test it before merge.

@MaggieQi MaggieQi merged commit 611e39c into microsoft:master Jun 19, 2019
MaggieQi added a commit to MaggieQi/SPTAG that referenced this pull request Jun 26, 2019
t-phada pushed a commit to t-phada/SPTAG that referenced this pull request Aug 19, 2020
* remove dup code

* Update Readme.md

* Fix DataSet GNU compile fail bug

* fix GNU Windows align alloc bugs

* add copyright in each file

* fix copy right in dataset

* change kdt distance judgement

* change code structure and add more wrappers

* Update docs

* fix search result

* change IndexBuilder to support binary input data

* temp remove java related projects

* remove javaclient and javacore from the windows build

* Fix SetData issue

* Add vector record count and dimension for reuse and debug

* change default parameter definition

* add uint8 support

* small fix for cosine distance of uint8

* fix AVX distance calculation epu8

* update readme

* Update DistanceUtils.h

* fix python wrapper cannot load larger than 4G memory error

* try to add C# wrapper

* fix owner of C# wrapper

* add C# cmake support

* fix byte array copy

* fix tab to space

* Try to make shared_ptr<T> as Array template

* fix copy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants