discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] gr::buffer::allocate_buffer: warning:


From: Manu T S
Subject: Re: [Discuss-gnuradio] gr::buffer::allocate_buffer: warning:
Date: Mon, 8 Jul 2013 01:08:29 +0530

Tom,

Yes, it is for my GSoC project. Till now I have prototyped in python encoder, decoder and construction of LDPC codes from Reed Solomon codes. The encoder and decoder input sizes vary based on the code block length and dimension.

I hope to switch gears to C++ soon.

Thanks.


On Sun, Jul 7, 2013 at 1:55 PM, Tom Rondeau <address@hidden> wrote:
On Fri, Jul 5, 2013 at 5:01 AM, Manu T S <address@hidden> wrote:
> A block that i designed takes a vector of length 408 with numpy.int32
> components. Work function just copies input to output. Work function
> definition is given below.
> ----------------------------------------------------------------------------------------------------
>     def work(self, input_items, output_items):
>         for i in range(len(input_items[0][0])):
>             print input_items[0][0][i],
>             output_items[0][0][i] = input_items[0][0][i]
>         return len(input_items[0])
> -----------------------------------------------------------------------------------------------------
>
> I'm getting the following warning.
>
> gr::buffer::allocate_buffer: warning: tried to allocate
>    40 items of size 1632. Due to alignment requirements
>    128 were allocated.  If this isn't OK, consider padding
>    your structure to a power-of-two bytes.
>    On this platform, our allocation granularity is 4096 bytes.
> gr::buffer::allocate_buffer: warning: tried to allocate
>    40 items of size 1632. Due to alignment requirements
>    128 were allocated.  If this isn't OK, consider padding
>    your structure to a power-of-two bytes.
>
> What could be the reason for this warning? What could be done to correct
> this?
>
> --
> Manu T S

Manu,

This has more to do with your io_signature declaration in the
constructor than the work function. It's simply that for memory
handling purposes, the buffers are set up to use multiples of pages,
and you are asking for a strange size. Basically, this should still
work, but you might be using a lot more memory for your buffers than
required.

I wouldn't worry about this for now. I'm assuming this is for your
GSoC project? If so, just keep going and make sure you get the math
right. You'll want to move this into a C++ block eventually, anyways,
and do further optimizations there. We can worry about this problem at
that point.

Tom



--
Manu T S

reply via email to

[Prev in Thread] Current Thread [Next in Thread]