使用iframe做网站短视频营销推广

web/2025/9/28 0:18:30/文章来源:
使用iframe做网站,短视频营销推广,室内设计培训,桂林最新新闻1. 背景#xff1a; 项目中使用到了纹理进行插值的加速#xff0c;因此记录一些自己在学习tex2D的一些过程 2. 代码#xff1a; #include cuda_runtime.h #include device_launch_parameters.h #include assert.h #include stdio.h 项目中使用到了纹理进行插值的加速因此记录一些自己在学习tex2D的一些过程 2. 代码 #include cuda_runtime.h #include device_launch_parameters.h #include assert.h #include stdio.h #include iostream #include cuda_fp16.h #include vectorvoid Data2Half(half* pDst, const int16_t* pSrc, const int Ndots); static __global__ void Tex2DTest(cudaTextureObject_t p_rf_data, float* pfRes1, float* pfRes2);static __global__ void data2half(half* pDst, const int16_t* pSrc, const int Ndots) {const int tid blockIdx.x * blockDim.x threadIdx.x;if (tid Ndots)return;pDst[tid] __short2half_rn(pSrc[tid]); }cudaTextureObject_t m_tex 0; cudaArray* m_pRFData nullptr; int16_t* m_i16RFDataBuffer nullptr; // 设备端的RF数据 half* m_pHalfRFDataCache nullptr; // 转换为半浮点型的RF数据缓存用于将SHORT类型转换为FLOAT类型int main() {const int nRx 2;const int Nsample 2;const int IQ 1;cudaError_t error;cudaChannelFormatDesc channelDesc cudaCreateChannelDescHalf();error cudaMallocArray(m_pRFData, channelDesc, nRx * IQ, Nsample, cudaArrayTextureGather);assert(m_pRFData);cudaResourceDesc texRes;memset(texRes, 0, sizeof(cudaResourceDesc));texRes.resType cudaResourceTypeArray;texRes.res.array.array m_pRFData;cudaTextureDesc texDescr;memset(texDescr, 0, sizeof(cudaTextureDesc));texDescr.normalizedCoords false;texDescr.filterMode cudaFilterModeLinear; // 这里很重要texDescr.addressMode[0] cudaAddressModeBorder;texDescr.addressMode[1] cudaAddressModeBorder;error cudaCreateTextureObject(m_tex, texRes, texDescr, NULL);//int16_t pi16Src[nRx * Nsample * IQ] {1, 11, 2, 22,// 3, 33, 4, 44, // 5, 55, 6, 66, // 7, 77, 8, 88};//int16_t pi16Src[nRx * Nsample * IQ] { 1, 11, 2, 22,// 3, 33, 4, 44};int16_t pi16Src[nRx * Nsample * IQ] { 1,2,3,4 };error cudaMalloc(m_i16RFDataBuffer, sizeof(int16_t) * nRx * IQ * Nsample);error cudaMemcpy(m_i16RFDataBuffer, pi16Src, sizeof(int16_t) * nRx * IQ * Nsample, cudaMemcpyHostToDevice);error cudaMalloc(m_pHalfRFDataCache, sizeof(half) * nRx * IQ * Nsample);Data2Half(m_pHalfRFDataCache, m_i16RFDataBuffer, nRx * IQ * Nsample);error cudaMemcpy2DToArray(m_pRFData, 0, 0, m_pHalfRFDataCache, sizeof(half) * nRx * IQ, sizeof(half) * nRx * IQ, Nsample, cudaMemcpyDeviceToDevice);float* pf_res1 nullptr;float* pf_res2 nullptr;error cudaMalloc(pf_res1, nRx * Nsample * sizeof(float)); cudaMemset(pf_res1, 0, nRx * Nsample * sizeof(float));error cudaMalloc(pf_res2, nRx * Nsample * sizeof(float)); cudaMemset(pf_res2, 0, nRx * Nsample * sizeof(float));error cudaGetLastError();dim3 block_dim dim3(1, 1);dim3 grid_dim dim3(1, 1);Tex2DTest grid_dim, block_dim (m_tex, pf_res1, pf_res2);cudaDeviceSynchronize();std::vectorfloat vf_res_1(nRx * Nsample, 0);std::vectorfloat vf_res_2(nRx * Nsample, 0);cudaMemcpy(vf_res_1.data(), pf_res1, sizeof(float) * vf_res_1.size(), cudaMemcpyDeviceToHost);cudaMemcpy(vf_res_2.data(), pf_res2, sizeof(float) * vf_res_2.size(), cudaMemcpyDeviceToHost);return 0; }void Data2Half(half* pDst, const int16_t* pSrc, const int Ndots) {dim3 block dim3(512, 1);dim3 grid dim3((Ndots - 1) / block.x 1, 1);data2half grid, block (pDst, pSrc, Ndots); }static __global__ void Tex2DTest(cudaTextureObject_t p_rf_data, float *pfRes1, float *pfRes2) {for (size_t y 0; y 2; y){for (size_t x 0; x 2; x) {float value tex2Dfloat(p_rf_data, x, y);//pfRes1[y * 4 y] printf(x: %f\n, value);}} }3. 输出分析 可以看到执行结果是 为什么呢 原因是因为tex2D插值导致的上面测试数据是 1  2 3   4 那在进行插值的时候会变成 0  0   0   0 0   1   2  0 0   3   4  0 每个点的输出都是当前前和左上角3个点进行平均计算出来的 比如第一个输出计算为1 0 0 0/4 0.25 最后一个输出的计算为1 2 3 4 / 4 2.5 4. 问题 上面只是单独数据实数点的计算如果我的数据集合是复数怎么办 比如一组2 * 2大小的数据对 1 2 3 4; 5,   6 7 8 数据实际表示含义是 1 j * 2,   3 j * 4; 5 j * 6,   7 j * 8 这种情况下怎么做到正确插值呢比如第一个实数点的输出结果应该是 1 0 0 0/ 4 最后一个实数点的输出应该是 1 3 5 7 / 4 同理最后一个虚数点的输出应该是            2 4 6 8/ 4 5. 解决 #include cuda_runtime.h #include device_launch_parameters.h #include assert.h #include stdio.h #include iostream #include cuda_fp16.h #include vectorvoid Data2Half(half* pDst, const int16_t* pSrc, const int Ndots); static __global__ void Tex2DTest(cudaTextureObject_t p_rf_data, float* pfRes1, float* pfRes2);static __global__ void data2half(half* pDst, const int16_t* pSrc, const int Ndots) {const int tid blockIdx.x * blockDim.x threadIdx.x;if (tid Ndots)return;pDst[tid] __short2half_rn(pSrc[tid]); }cudaTextureObject_t m_tex 0; cudaArray* m_pRFData nullptr; int16_t* m_i16RFDataBuffer nullptr; // 设备端的RF数据 half* m_pHalfRFDataCache nullptr; // 转换为半浮点型的RF数据缓存用于将SHORT类型转换为FLOAT类型using namespace std;int main() {const int nRx 2;const int Nsample 2;const int IQ 2;cudaError_t error;cudaChannelFormatDesc channelDesc cudaCreateChannelDescHalf2();error cudaMallocArray(m_pRFData, channelDesc, nRx, Nsample, cudaArrayTextureGather);assert(m_pRFData);cudaResourceDesc texRes;memset(texRes, 0, sizeof(cudaResourceDesc));texRes.resType cudaResourceTypeArray;texRes.res.array.array m_pRFData;cudaTextureDesc texDescr;memset(texDescr, 0, sizeof(cudaTextureDesc));texDescr.normalizedCoords false;texDescr.filterMode cudaFilterModeLinear; // 这里很重要texDescr.addressMode[0] cudaAddressModeBorder;texDescr.addressMode[1] cudaAddressModeBorder;error cudaCreateTextureObject(m_tex, texRes, texDescr, NULL);//int16_t pi16Src[nRx * Nsample * IQ] {1, 11, 2, 22,// 3, 33, 4, 44, // 5, 55, 6, 66, // 7, 77, 8, 88};//int16_t pi16Src[nRx * Nsample * IQ] { 1, 11, 2, 22,// 3, 33, 4, 44};int16_t pi16Src[nRx * Nsample * IQ] { 1, 2, 3, 4,5, 6, 7, 8 };error cudaMalloc(m_i16RFDataBuffer, sizeof(int16_t) * nRx * IQ * Nsample);error cudaMemcpy(m_i16RFDataBuffer, pi16Src, sizeof(int16_t) * nRx * IQ * Nsample, cudaMemcpyHostToDevice);error cudaMalloc(m_pHalfRFDataCache, sizeof(half) * nRx * IQ * Nsample);Data2Half(m_pHalfRFDataCache, m_i16RFDataBuffer, nRx * IQ * Nsample);error cudaMemcpy2DToArray(m_pRFData, 0, 0, m_pHalfRFDataCache, sizeof(half2) * nRx, sizeof(half2) * nRx, Nsample, cudaMemcpyDeviceToDevice);float* pf_res1 nullptr;float* pf_res2 nullptr;error cudaMalloc(pf_res1, nRx * Nsample * sizeof(float)); cudaMemset(pf_res1, 0, nRx * Nsample * sizeof(float));error cudaMalloc(pf_res2, nRx * Nsample * sizeof(float)); cudaMemset(pf_res2, 0, nRx * Nsample * sizeof(float));error cudaGetLastError();dim3 block_dim dim3(1, 1);dim3 grid_dim dim3(1, 1);Tex2DTest grid_dim, block_dim (m_tex, pf_res1, pf_res2);cudaDeviceSynchronize();std::vectorfloat vf_res_1(nRx * Nsample, 0);std::vectorfloat vf_res_2(nRx * Nsample, 0);cudaMemcpy(vf_res_1.data(), pf_res1, sizeof(float) * vf_res_1.size(), cudaMemcpyDeviceToHost);cudaMemcpy(vf_res_2.data(), pf_res2, sizeof(float) * vf_res_2.size(), cudaMemcpyDeviceToHost);return 0; }void Data2Half(half* pDst, const int16_t* pSrc, const int Ndots) {dim3 block dim3(512, 1);dim3 grid dim3((Ndots - 1) / block.x 1, 1);data2half grid, block (pDst, pSrc, Ndots); }static __global__ void Tex2DTest(cudaTextureObject_t p_rf_data, float* pfRes1, float* pfRes2) {for (size_t y 0; y 2; y){for (size_t x 0; x 2; x){float2 value tex2Dfloat2(p_rf_data, x, y);//pfRes1[y * 4 y] printf(x: %f, y: %f, value.x, value.y);// printf(x: %f, y: %f\n, value.x, value.y);}printf(\n);} }其实关键是在tex2D的构造 然后按照half2的方式进行排布就好了

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/83038.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

外贸网站建设公司渠道电子商务网站策划书3500字

这是 OpenStack 实施经验分享系列的第 12 篇。 问题描述 客户报告了一个问题:对 instance 执行 migrate 操作,几个小时了一直无法完成,不太正常。 问题分析 遇到这种情况,第一个要检查的就是 instance 所在计算节点的 nova-comput…

成都企业网站公司WordPress 默认链接 媒体文件

一、Arrays的概述 Arrays是操作数组的工具类 二、Arrays的常用方法 Arrays的常用方法基本上都被static静态修饰,因此在使用这些方法时,可以直接通过类名调用 1.toString 语法:Arrays.toString(数组) 用于将数组的元素转换为一个字符串&a…

响应式网站设计软件网络营销网站建设实训

转载于:https://www.cnblogs.com/anc-ox/p/10004571.html

网站建设佛山拓客科技公司音乐网站怎么做社交的

在使用这个框架的时候,我们必须要配置一个DisplayImageOptions对象来作为ImageLoader.getInstance().displayImage()中的参数,所以很有必要讲解这个对象的配制方法。讲解完了后其实这个框架我们就会了解的比较详尽了。 1.默认的配…

屯留网站建设著名建筑设计案例

linux的方法在下面 Windows服务器远程连接 登录控制台查看服务器系统是什么系统例如阿里云的ECS服务器 Windows系统可以使用微软自带的远程工具进行连接,可以连接的系统有Windows server 和Windows 7-10 等等系列;Windows系统,例如Windows10系…

张家界旅游网站官网网站icp备案信息如何查询

近年来,STEAM教育越来越深入我们的生活,但STEAM教育到底是什么呢?来源于美国的“STEAM教育”是将五大学科——科学(Science)、技术(Technology)、工程(Engineering)、艺术…

做网站需要拉多大的宽带南联网站建设公司

刚开始写了一个暴力的dfs超时了&#xff0c; 最后看了下题解说是先枚举答案再判断&#xff0c;然后就写了双dfs&#xff0c;全部秒杀&#xff0c;代码如下&#xff1a; /*ID: m1500293LANG: CPROG: milk4 */ #include <cstdio> #include <cstring> #include <al…

外贸业务怎么利用网站开发客户那个网站做网站托管

每次要给财务提交timecard报表&#xff0c; 就会遇到那些乱七八糟的事情&#xff0c; 浪费时间而无意义&#xff0c; 几个小时之后&#xff0c;我真的都想杀人&#xff0c; 在杀人与不杀之间徘徊良久&#xff0c;终于忍住&#xff0c; 那些PM根本就不负起自己的责任&#xff0c…

网站建设好卖吗2345电影新网站模板

MySql之索引 1.索引概述 MySql官方对索引的定义为&#xff1a;索引是帮助MySql高效获取数据的数据结构。在数据之外&#xff0c;数据库系统还维护着满足特定查找算法的数据结构&#xff0c;这些数据结构以某种方式引用数据&#xff0c;这样就可以在这些数据结构上实现高级查找…

附近的网站建设公司家电维修怎么自己做网站

我之前只看到了数据结构与算法的冰山一角&#xff0c;感觉这些术语只会让知识越来越难理解&#xff0c;现在来看&#xff0c;他们完美抽象一些概念和知识&#xff0c;非常重要。 本篇概念肯定总结不全&#xff0c;只有遇到的会写上&#xff0c;持续更新&#xff0c;之前文章已经…

果洛wap网站建设比较好为什么无法登录建设银行网站

nginx的限速和限制并发连接数、限制请求数 限速&#xff08;Rate Limiting&#xff09;&#xff1a; 限速允许你控制对服务器的请求速率&#xff0c;以防止过多的请求影响服务器性能。使用 limit_req_zone 指令定义一个共享内存区域&#xff0c;并在 location 块中使用 limit_r…

深圳龙华新区网站建设外贸网络推广网

基于springbootjpamysqlhtml网上中药商城系统 一、系统介绍二、功能展示1.主页(客户)2.登陆&#xff08;客户&#xff09;3.注册&#xff08;客户&#xff09;4.购物车(客户)5.我的订单&#xff08;客户&#xff09;6.用户管理&#xff08;管理员&#xff09;7.分类管理&#x…

企业产品推广网站服装设计师

首先用photoshop打开作为微博背景的图片,还有二维码图片。 然后将二维码图片整合到背景图片的适当位置,并编写相关说明,如下图。 然后将图片保存到桌面。 打开微博,可以看到左侧现在是没有二维码的

网站建设服务哪家便宜全渠道运营平台系统

减肥方法很多。选择减肥方法时应以物理减肥和减少饮食为主。不应该以口服药物为主。常用减肥方法有&#xff1a; ① 预防性减肥&#xff1b; ②运动减肥&#xff1b; ③行为减肥&#xff1b; ④机械减肥&#xff1b; ⑤ 桑那浴减肥&#xff1b; ⑥石膏减肥&#xff1b; ⑦石腊减…

怎样在门户网站做网络推广辽宁省住房和城乡建设厅证件查询

近日&#xff0c;ABB为国网冀北电力有限公司定制了智能配电计量与协调控制解决方案&#xff0c;对其虚拟电厂进行远程电能管理&#xff0c;实现高峰调节和负载转移&#xff0c;提高电力系统效率&#xff0c;保持供电稳定性。虚拟电厂是通过分布式电力管理系统将电网中发电端(尤…

湖南网站建设多少钱wordpress主题 个人博客

一、摘要 在快节奏的现代生活中&#xff0c;宠物已成为许多家庭不可或缺的一部分。然而&#xff0c;宠物照看服务的需求也随之增长。为了满足这一需求&#xff0c;我们设计并实现了一款同城宠物照看系统&#xff0c;该系统利用Java技术和MySQL数据库&#xff0c;为用户提供一个…

手机 网站 分辨率建立公司需要多少资金

随着互联网的发展&#xff0c;保护用户在网上交换的敏感信息的安全性变得至关重要。HTTPS&#xff08;Hypertext Transfer Protocol Secure&#xff09;作为一种安全的通信协议&#xff0c;通过加密数据传输&#xff0c;保护用户的隐私和数据安全。然而&#xff0c;尽管HTTPS提…

网站推广的概念茶叶营销策划方案

最小二乘法&#xff08;Least Squares&#xff09;是一种用于寻找线性回归模型的最佳拟合直线的标准方法。它通过最小化数据点与拟合直线之间的平方差来找到最佳拟合的线性模型。 线性回归模型 假设我们有一组数据点 (xi,yi)&#xff0c;线性回归模型的目标是找到系数 w 和截…

宁波网站建设设计佛山网站建设找方维网络

LeetCode 287 寻找重复数 难度&#xff1a;中等 题目&#xff1a; 给定一个包含 n 1 个整数的数组 nums &#xff0c;其数字都在 [1, n] 范围内&#xff08;包括 1 和 n&#xff09;&#xff0c;可知至少存在一个重复的整数。 假设 nums 只有 一个重复的整数 &#xff0c;返回…

网站建立的优劣势wordpress 最快的版本

做Java开发工作好多年了。今天偶然翻到 java.lang.TypeVariable的源码&#xff0c;好奇为什么 TypeVariable.getBounds()返回类型是个数组。 一般不都是<T extends Number> 这样用码&#xff1f;T难道还能extends多个类型&#xff1f; 同问&#xff1a;不应该是extend,为…