Comments (3)
I wonder however if this is correct... in the
test_1
it didn't increment in the array. I added it, however... I am also curious about why the range of iis only from 0 to 9... should it not be 0totest_size-1
?
The argument a
of test_1
is a numpy array.
Thus, a *= 0
clears the entire contents of the array, and a += 0x31
adds 0x31 to each element of the array.
This is repeated 10 times and the time it takes is measured.
from udmabuf.
I solved it... the code should call the attribute udmabuf.array
instead.
There were also some code typos that I fixed here:
from udmabuf import Udmabuf
import numpy as np
import time
def test_1(a):
for i in range (0,9):
a[i] *= 0
a[i] += 0x31
if __name__ == '__main__':
udmabuf = Udmabuf('udmabuf0')
test_dtype = np.uint8
test_size = udmabuf.buf_size//(np.dtype(test_dtype).itemsize)
comparison = np.zeros(test_size, dtype=test_dtype)
udmabuf.memmap(dtype=test_dtype, shape=(test_size))
print ("test_size : %d" % test_size)
start = time.time()
test_1(udmabuf.array)
elapsed_time = time.time() - start
print ("udmabuf-0 : elapsed_time: {0}".format(elapsed_time) + " sec" )
start = time.time()
test_1(comparison)
elapsed_time = time.time() - start
print ("comparison : elapsed_time: {0}".format(elapsed_time) + " sec")
if np.array_equal(udmabuf.array, comparison):
print ("udmabuf-0 == comparison : OK")
else:
print ("udmabuf-0 != comparison : NG")
I wonder however if this is correct... in the test_1`` it didn't increment in the array. I added it, however... I am also curious about why the range of
iis only from 0 to 9... should it not be 0 to
test_size-1``` ?
Btw, feel free to use the code to be included in your readme file :)
from udmabuf.
Thank you for the issue.
Readme.md was corrected.
from udmabuf.
Related Issues (20)
- Unusual issue when mmapping udmabuf for network transfer HOT 6
- Cache coherency problem on ARM in u-dma-buf 4.4.0
- memory-region HOT 4
- Unsupported node format error in Dmesg HOT 6
- Build failure since kernel v6.3 HOT 1
- PetaLinux 2023.1 / Yocto Langdale build - no .ko files are installed, thus no package is created HOT 12
- Could this be used with V4L2/libcamera buffers on the Raspberry Pi 4 (Arm A72) HOT 6
- Doubts with DMA coherency mode and quirk-mmap HOT 5
- AXI MCDMA support? HOT 6
- Once the creation of a device fails, a device with the same name cannot be created.
- Using udmabuf on linux zynq7020 HOT 3
- Do you plan support for versal devices? HOT 1
- udmabuf can't be build on kernel >= 6.6.0 HOT 1
- name conflict with udmabuf driver in mainline linux HOT 1
- Xilinx Zynqmp: The read data is inconsistent with the data written by the PL HOT 47
- Cannot write mmap'ed buffer content to disk using O_DIRECT flag HOT 6
- Difference with upstream driver HOT 3
- Attempting to allocate a large buffer in the CMA area of reserved_memory fails to allocate pages HOT 2
- > I ran into the same issue on an x86_64 and it was fixed by changing the dma_mask_bit module parameter like so: `insmod udmabuf.ko dma_mask_bit=64 udmabuf0=8388608` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from udmabuf.