Skip to content

Helper macros for indexing operation, creation of dim4 and sequence objects #230

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

Merged
merged 7 commits into from
Jul 18, 2020
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
75 changes: 75 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
name: A generic bug Report
about: Create a bug report to help us improve ArrayFire
title: "[BUG]"
labels: 'Bug'
assignees: ''
---


Description
===========
<!--
* Details regarding the bug
* Did you build ArrayFire yourself or did you use the official installers
* Which backend is experiencing this issue? (CPU, CUDA, OpenCL)
* Do you have a workaround?
* Can the bug be reproduced reliably on your system?
* A clear and concise description of what you expected to happen.
* Run your executable with AF_TRACE=all and AF_PRINT_ERRORS=1 environment
variables set.
* Screenshot or terminal output of the results from above run
-->

Reproducible Code and/or Steps
------------------------------
<!--
* Steps or code snippet that can reproduce the bug
* A full example will allow us to debug and fix the bug faster
-->

System Information
------------------
<!--
Please provide the following information:
1. ArrayFire version
2. Devices installed on the system
3. (optional) Output from the af::info() function if applicable.
4. Output from the following scripts:

Run one of the following commands based on your OS

Linux:
```sh
lsb_release -a
if command -v nvidia-smi >/dev/null; then
nvidia-smi --query-gpu="name,memory.total,driver_version" --format=csv -i 0
else
echo "nvidia-smi not found"
fi
if command -v /opt/rocm/bin/rocm-smi >/dev/null; then
/opt/rocm/bin/rocm-smi --showproductname
else
echo "rocm-smi not found."
fi
if command -v clinfo > /dev/null; then
clinfo
else
echo "clinfo not found."
fi
```

Windows:
Download clinfo from https://github.com/Oblomov/clinfo

If you have NVIDIA GPUs. Run nvidia-smi usually located in
C:\Program Files\NVIDIA Corporation\NVSMI

Provide driver version for your GPU. (This is vendor specific)
-->

Checklist
---------

- [ ] Using the latest available ArrayFire release
- [ ] GPU drivers are up to date
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/build_error.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Build Error
about: Create a report for errors during the crate build
title: "[Build]"
labels: 'Bug,Build'
assignees: '9prady9'
---

Description
===========
<!--
A short one or two line description of the error
-->

Build Environment
-----------------
Compiler version: <!-- MSVC v140 or gcc 9.3.2 -->
Operating system: <!-- Windows 10; Ubuntu 18.04 -->
Build environment: <!-- Environment variables; Installed software -->

Error Log
---------
<!-- Output of the error log. -->
```

```
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Feature Request
about: Suggest a new idea for Rust wrapper of ArrayFire
title: 'Feature'
labels: 'Feature'
assignees: '9prady9'

---

Description
===========
<!--
* If it is new function you want to add, please raise the feature request on [arrayfire](https://github.com/arrayfire/arrayfire/issues) repository.
* If it is rust specific improvement or enhancement to existing feature, please explain the details.
-->
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/performance_issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Performance Issue
about: For Issues related to lackluster performance
title: "[Perf]"
labels: 'Bug,Upstream'
assignees: '9prady9'

---

Description
===========

<!-- One or two line description of the performance issue -->

<!--
* Did you build ArrayFire yourself or did you use the official installers
* Which backend is experiencing this issue? (CPU, CUDA, OpenCL)
* Can the bug be reproduced reliably on your system using Rust wrapper?
* Can the bug be reproduced reliably using C++ API of ArrayFire? Kindly try and report any
performance issues found directly on [arrayfire](https://github.com/arrayfire/arrayfire/issues) repository.
-->

Reproducible Code
-----------------
<!--
* Provide a small example that could reproduce the performance issue
* A full example will allow us to debug and fix this issue faster
-->

System Information
------------------
ArrayFire Version:
Device:
Operating System:
Driver version:

Checklist
---------
- [ ] I have read [timing ArrayFire C++ API](http://arrayfire.org/docs/timing.htm)
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Question
about: General questions and potential issues
title: "[Question]"
labels: 'Question'
assignees: '9prady9'

---

Before asking a question on github, please consider if it is more appropriate for these other platforms:

* [Slack Chat](https://join.slack.com/t/arrayfire-org/shared_invite/MjI4MjIzMDMzMTczLTE1MDI5ODg4NzYtN2QwNGE3ODA5OQ)
* [Google Groups](https://groups.google.com/forum/#!forum/arrayfire-users)
* ArrayFire Services: [Consulting](http://arrayfire.com/consulting/) | [Support](http://arrayfire.com/support/) | [Training](http://arrayfire.com/training/)
20 changes: 20 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!--
Short description of change in documentation
-->

Description
-----------
<!--
Additional information about the PR answering following questions:

* Is this new addition to documentation ?
* Is this change correction of existing documentation?
* More detail if necessary to describe all commits in pull request.
-->
Fixes: #<issue number> ...

Checklist
---------
- [ ] Rebased on latest master
- [ ] Documentation Generation Successful
- [ ] Documentation Tests Pass
36 changes: 36 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/generic_pr_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

<!--
Short description of change

This should be one or two sentences that describe the overall
motivation of the PR. Description of what was done for an unfamiliar
reviewer.
-->

Description
-----------
<!--
Additional information about the PR answering following questions:

* Is this a new feature or a bug fix?
* More detail if necessary to describe all commits in pull request.
* Why these changes are necessary.
* New functions and their functionality.
* Future changes not implemented in this PR.
-->
Fixes: #<issue number> ...

Changes to Users
----------------
<!--
* Additional options added to the build.
* What changes will existing users have to make to their code or build steps?
-->

Checklist
---------
<!-- Check if done or not applicable -->
- [ ] Rebased on latest master
- [ ] Code compiles
- [ ] Tests pass
- [ ] Functions documented
14 changes: 14 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/new_example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!--
Short description of the new example
-->

Description
-----------
<!--
What feature of rust wrapper or ArrayFire is the example show casing?
-->

Checklist
---------
- [ ] Rebased on latest master
- [ ] Code compiles
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: Build and Test Wrapper
runs-on: ubuntu-18.04
env:
AF_VER: 3.7.0
AF_VER: 3.7.2
steps:
- name: Checkout Repository
uses: actions/checkout@master
Expand Down
19 changes: 18 additions & 1 deletion src/dim4.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::fmt;
use std::ops::Index;
use std::ops::{Index, IndexMut};

/// Dim4 is used to store [Array](./struct.Array.html) dimensions
#[derive(Copy, Clone, PartialEq, Debug)]
Expand Down Expand Up @@ -35,6 +35,23 @@ impl Index<usize> for Dim4 {
}
}

/// Enables index operation for Dim4 to modify dimensions
///
/// # Examples
///
/// ```rust
/// use arrayfire::Dim4;
///
/// let mut dims = Dim4::new(&[4, 4, 2, 1]);
/// dims[2] = 4;
/// println!("Dimensions: {}", dims); // note that third dimension changed to 4
/// ```
impl IndexMut<usize> for Dim4 {
fn index_mut(&mut self, _index: usize) -> &mut Self::Output {
&mut self.dims[_index]
}
}

/// Enables use of Dim4 objects for printing it to display
///
/// # Examples
Expand Down
Loading