Programmazione Funzionale e Parallela

Corso di Laurea in Ingegneria Informatica e Automatica - A.A. 2017-2018

HomePage | Avvisi | Diario lezioni | Materiale didattico | Esami | Forum | Login

Revision [916]

Last edited on 2017-12-14 12:02:04 by CamilDemetrescu
Additions:
#define IDX(x,y,w) ((y)*(w)+(x))
__kernel void mirror(__global unsigned char* I,
__global unsigned char* O,
int h, int w) {
int x = get_global_id(0);
int y = get_global_id(1);
if (x >= w || y >= h) return;

unsigned char pixel = I[IDX(x,y,w)];
O[IDX(x,y,w)] = pixel;
O[IDX(x,2*h-y-1,w)] = pixel;
Deletions:
// =====================================================================
// mirror.c
// =====================================================================
// Author: (c) 2017 Camil Demetrescu
// License: See the end of this file for license information
// Created: Dec 7, 2017
// Last changed: $Date: 2017/12/07 --:--:-- $
// Changed by: $Author: demetres $
// Revision: $Revision: 1.00 $
// Copyright (C) 2017 Camil Demetrescu
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA


Revision [915]

Edited on 2017-12-14 12:01:13 by CamilDemetrescu
Additions:
// =====================================================================
// mirror.c
// =====================================================================
// Author: (c) 2017 Camil Demetrescu
// License: See the end of this file for license information
// Created: Dec 7, 2017
// Last changed: $Date: 2017/12/07 --:--:-- $
// Changed by: $Author: demetres $
// Revision: $Revision: 1.00 $
// Copyright (C) 2017 Camil Demetrescu
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA


Revision [914]

The oldest known version of this page was created on 2017-12-14 12:00:13 by CamilDemetrescu
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki
Page was generated in 0.0155 seconds